Reputation: 649
Im doing a web project in Blazor WebAssembly and i want to add a specific CSS file to one of my .razor files but i have no idea on earth how to do it.
Any one who knows how i add a CSS for ListProducts.razor ?
Upvotes: 5
Views: 14578
Reputation: 640
If you want css file to be specific to one razor file then create css file in same directory with {razor_file_name}.razor.css.
For you case ListProducts.razor.css
info: Microsoft docs
Upvotes: 10
Reputation: 303
You should already have a premade app.css
file located in wwwroot/css/app.css
Add the CSS for your entire app there
Upvotes: -1
Reputation: 18209
Here is a working demo:
My wwwroot folder:
.razor file:
<link rel="stylesheet" href="css/bootstrap/bootstrap1.min.css" />
@code {
...
}
Upvotes: 3