【发布时间】:2022-01-10 09:48:28
【问题描述】:
我在 Blazor 中将一些来自 bootstraps 网站的自定义 CSS 添加到我的 app.css 文件中,而该文件是在 Visual Studio 中编辑并保存的。当应用程序启动并加载 app.css 时,它会加载旧版本的 app.css,而无需我进行任何更改。有谁知道为什么会发生这种情况?提前致谢
编辑的 CSS 文件
// ... some more css above....
.b-example-divider {
height: 3rem;
background-color: rgba(0, 0, 0, .1);
border: solid rgba(0, 0, 0, .15);
border-width: 1px 0;
box-shadow: inset 0 0.5em 1.5em rgb(0 0 0 / 10%), inset 0 0.125em 0.5em rgb(0 0 0 / 15%);
}
#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}
#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}
应用程序加载 app.css
【问题讨论】:
-
您是否在打开开发人员工具的情况下尝试了 CTRL-F5?
-
@BrianParker 这样做可以让 app.css 正确显示。这是做什么的,我每次都必须这样做吗?
-
清除缓存。 CSS 仅在 dev 中是动态的。我不会太强调它。
标签: css blazor blazor-webassembly