How to customize Bootstrap? [closed]

北慕城南 提交于 2019-12-17 22:03:59

问题


I want to customize bootstrap using new colors for navs and such. How would I create a separate css file that overrides some of the things on bootstrap.css? (I don't want to mess with the bootstrap css files, incase there are updates to bootstrap, and I don't have to re-add anything).

How do I change the color of the navbar in my custom CSS file?


回答1:


You can add the custom stylesheet after include bootstrap:

<link href="bootstrap.css" rel="stylesheet" type="text/css" />
<link href="mySpecial.css" rel="stylesheet" type="text/css" />

Then, you override the styles you want. So will be something like:

.btn-success {
  color: orange;
}

for an ugly orange text green button.




回答2:


Just create a new stylesheet, link to that below the bootstrap stylesheet then you can use the same CSS rules and your new stylesheet will over-ride bootstrap because it is linked to afterwards.



来源:https://stackoverflow.com/questions/18068397/how-to-customize-bootstrap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!