How to customize Bootstrap? [closed]

2020-02-07 12:48发布

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?

2条回答
我只想做你的唯一
2楼-- · 2020-02-07 13:26

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.

查看更多
ゆ 、 Hurt°
3楼-- · 2020-02-07 13:48

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.

查看更多
登录 后发表回答