英文:
How to update Reboot CSS in Blazor Server
问题
我正在使用Blazor Server编写一个应用程序。我试图更新CSS,但似乎没有生效。
更多细节:
我使用了MSFT Convert Standard Nav Menu来创建一个漂亮的侧边菜单,支持子菜单组件。我想要更改元素的填充。在Chrome开发者工具中,我已经找到了相应的CSS并按照自己的喜好进行了更改。然而,当我在项目中找到相同的CSS时,它不起作用!明确一下,我在wwwroot/css/bootstrap/bootstrap.min.css/bootstrap.css.min.map中找到了这个CSS。
我尝试过的方法:
- 清除缓存
- 使用不同的浏览器和隐身模式
- 仔细搜索CSS,确保没有遗漏的部分。
我不是专业的网页开发者,所以任何帮助都会感激。
英文:
I am using Blazor Server to write an app. I am trying to update the CSS and it does not seem to be taking.
More detail:
I have used MSFT Convert Standard Nav Menu to make a nice-looking side menu that supports sub-menu components. I am looking to change the padding on the elements. Using the Chrome Developer console, I have isolated the CSS and changed it to my liking. However, when I find that very same CSS in my project, it doesn't work! To be clear I found the CSS in wwwroot/css/bootstrap/bootstrap.min.css/bootstrap.css.min.map.
What have I tried:
- Clearing the cache
- Using different browsers and incognito mode
- Searching the CSS exhaustively to ensure there is nothing else I am missing.
I am not a web developer by trade, so all help is appreciated.
答案1
得分: 1
不要直接编辑导入库中的文件,因为将这些文件升级到新版本可能会覆盖您的代码:记住您修改/添加的内容会很麻烦。
此外,引导文件通常是经过缩小的,这使得情况更不明确,但表明不应编辑它们。
只需创建一个自定义CSS文件来覆盖Bootstrap的样式。确保在Bootstrap之后调用该文件。
英文:
You should not edit directly files from imported libraries because upgrading those to newer versions may overwrite your code: remembering what you modified/added would be a pain.
Moreover, bootstrap files are often minified, which makes it even less clear but suggests that it shouldn't be edited.
Simply create a custom css file to override bootstrap styling. Make sure to call the file after bootstrap.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论