英文:
CSS from Blazor Component Lib not loaded
问题
I want to use my custom CSS located in wwwroot/css/
in my BlazorControllers/Components/
files, but nothing is loaded during execution. Is there something I need to specify in the client or library project settings?
My library project is BlazorControllers
, and I'm using the library's components in the client project.
英文:
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
得分: 8
在你的Index.html(或_Host.cshtml)文件中,在site.css行下添加:
<link href="_content/<YourLibrary>/styles.css" rel="stylesheet" />
其中<YourLibrary>
在你的情况下似乎是BlazorControllers。
并且,如果我理解图片正确的话,你还需要添加:
<link href="_content/BlazorControllers/css/MyComponents.css" rel="stylesheet" />
英文:
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" />
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论