Change icon-bar (☰) color in bootstrap

后端 未结 7 1053
渐次进展
渐次进展 2020-12-13 12:39

I want to change ☰ color.

HTML:

7条回答
  •  悲哀的现实
    2020-12-13 13:21

    The reason your CSS isn't working is because of specificity. The Bootstrap selector has a higher specificity than yours, so your style is completely ignored.

    Bootstrap styles this with the selector: .navbar-default .navbar-toggle .icon-bar. This selector has a B specificity value of 3, whereas yours only has a B specificity value of 1.

    Therefore, to override this, simply use the same selector in your CSS (assuming your CSS is included after Bootstrap's):

    .navbar-default .navbar-toggle .icon-bar {
        background-color: black;
    }
    

提交回复
热议问题