问题
I want to use my customs CSS located on the wwwroot/css/.
in my BlazorControllers/Components/.
files but nothing is loaded at execution.
Is there something to specify in the client or in the lib project settings ?
My Library project is BlazorControllers
and I use the component of the library in the Client project
回答1:
In your Index.html (or _Host.cshtml) file, below the site.css line, add
<link href="_content/<YourLibrary>/styles.css" rel="stylesheet" />
where <YourLibrary>
seems to be BlazorControllers in your case.
And when I read that picture right you (also) need
<link href="_content/BlazorControllers/css/MyComponents.css" rel="stylesheet" />
来源:https://stackoverflow.com/questions/59609028/css-from-blazor-component-lib-not-loaded