I read in many tutorials :
Just create a file containing the same filename of the page plus .css - Example: for Orders.razor, create a file Orders.razor.css
Add your style on the css file and have fun
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
}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With