I've been trying to change the text color in a bootstrap template's navbar and have been unsuccessful. Anyone know where I'm going wrong? Here is my code.
<!--navbar-->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner" id="nav-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">Restaurant</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#"><i class="icon-home icon-white"></i> Home</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"> </b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
</ul>
</li>
</ul>
<form class="navbar-search pull-right" action="">
<input type="text" class="search-query span2" placeholder="Search">
</form>
</div><!-- /.nav-collapse -->
</div><!-- /.container -->
</div><!-- /.navbar-inner -->
</div><!-- /.navbar -->
<!--navbar-->
The CSS:
.navbar-inner {
color: #FFF;
}
I also tried this:
#nav-inner {
color: #FFF;
}
Changing the text color The text color of the navigation bar can be changed using two inbuilt classes: navbar-light: This class will set the color of the text to dark. This is used when using a light background color. navbar-dark: This class will set the color of the text to light.
You can specify the background color using the bg- classes: bg-light, bg-dark, bg-info, bg-danger, bg-primary, bg-warning, or bg-success . Use navbar-dark for lighter text color (white), or navbar-light for darker text color (black).
Color schemes Theming the navbar has never been easier thanks to the combination of theming classes and background-color utilities. Choose from .navbar-light for use with light background colors, or .navbar-dark for dark background colors. Then, customize with .bg-* utilities.
The navbar-default gives a grayish look to the navigation bar while inverse gives it black. In order to customize the navigation bar as per the needs or match with the theme of your website, you need to work with these classes and override the default scheme or create your own custom class with the required properties.
If you want to change the css for the tabs you need to add color: #ddd;
to the following
.navbar .nav > li > a {
float: none;
line-height: 19px;
padding: 9px 10px 11px;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
color: #ddd;
}
Hope it helps!!
My guess is that Bootstrap defines a more specific CSS rule that is winning out over your more general rule. You should examine the page with Firefox or Chrome's developer tools to see which styles are winning out over others. If your style doesn't even show up, then you know there's a more basic problem, but if Bootstrap's style is overriding your color, you have to give your style a higher precedence.
For a sanity check, try this overkill rule:
html body .navbar .navbar-inner .container {
color: #FFF;
}
And if that works, then experiment with a lower level of specificity to see how specific you really need to get.
If all else fails, you can always do:
color: #FFF !important;
The CSS2 specification lays this out in detail.
.navbar .nav > li > a {
float: none;
color: #5FC8D6;
background-color: #002E36;
}
.navbar .nav > li > a:hover {
float: none;
color: #002E36;
background-color: #5FC8D6;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With