2017-02-01 63 views
0

的颜色的BTN-默认颜色是white.But我无法改变的BTN-默认如何改变BTN-默认

<div class="pageOne"> 
    <h1 class="text-center" id="header_text"> a Good Tree production </h1> 
    <div class="btnList"> 
     <a class="btn btn-default" href = "#"> a Good Tree production</a> 
     <a class="btn btn-default" href = "#"> About Us</a> 
     <a class="btn btn-default" href = "#"> Contact Us</a> 
     <a class="btn btn-default" href = "#"> Works</a> 
    </div> 
</div> 

这里的颜色是CSS

.btn-default{ 
    background-color: black !important; 
} 
#header_text{ 
    font-family: 'Boogaloo', cursive; 
    color: white !important; 
} 

任何人都可以帮助我。

+0

工作对我来说HTTP://www.bootply。 com/KFcqllfiQN – j08691

回答

0

Bootstrap CSS覆盖你的。您需要提供更高级别的CSS选择器,如:

#header_text .btn-default { 
    background-color: black !important; 
} 

这是级别高于引导选择,那就是:

.btn.btn-default { 
    /* Whatever their CSS is */ 
} 
+0

.btn.btn-default { \t background-color:black!important; } #header_text { \t font-family:'Boogaloo',cursive; \t颜色:白色!重要; \t}但它仍然不起作用 –

+0

没错,没有注意到'!important'。我没有看到任何理由不工作,也许你应该检查你的CSS是否真的显示出来。你有我们可以看的现场版吗? – TricksfortheWeb

+0

https://jsfiddle.net/VijayVj7/trbddvet/1/这是现场输出的链接 –