无法加载Blazor Component Lib中的CSS [英] CSS from Blazor Component Lib not loaded
问题描述
我想使用位于我的BlazorControllers/Components/.
文件中wwwroot/css/.
上的海关CSS,但是在执行时未加载任何内容.
在客户端或lib项目设置中是否要指定某些内容?
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 ?
我的图书馆项目是BlazorControllers
,我在客户端项目中使用了图书馆的组件
My Library project is BlazorControllers
and I use the component of the library in the Client project
推荐答案
在您的Index.html(或_Host.cshtml)文件中,在site.css行下方,添加
In your Index.html (or _Host.cshtml) file, below the site.css line, add
<link href="_content/<YourLibrary>/styles.css" rel="stylesheet" />
在您的情况下,其中<YourLibrary>
似乎是BlazorControllers.
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" />
这篇关于无法加载Blazor Component Lib中的CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!