Marco Jr
Marco Jr

Reputation: 6796

Why CSS Isolation in Blazor is not working?

I read in many tutorials :

Ok, but this is not working. So, what is the correct approach ? To reproduce:

Expected result: Hello, world! in red

Received: Hello, world! in black

Index.razor

@page "/"
<h1>Hello, world!</h1>
Welcome to your new app.
<SurveyPrompt Title="How is Blazor working for you?" />

Index.razor.css

h1 {
   color: red
}

Upvotes: 4

Views: 3193

Answers (1)

Vencovsky
Vencovsky

Reputation: 31625

For .razor.css files to work, you need to be using .net5

Take a look at the docs and see if you didn't miss any step

Upvotes: 4

Related Questions