Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Over-riding twitter bootstrap navbar font colors.

Hi, I'm building myself a CV using Twitter bootstrap CSS framework.

I'm currently building the navigation bar. I want to over-ride the font colour to make it white rather than the grey it is currently set to. I have a my-styles.css file that is linked to in the top of my index.html file. The code looks like the following:

<div class="navbar navbar-inverse navbar-fixed-top logo">
    <div class="container">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand text-muted logo">Gareth Edwards CV</a>
        <div class="collapse navbar-collapse">
          <ul class="nav navbar-nav navbar-right">
              <li><a href="#">Career History</a></li>
              <li><a href="#">Education</a></li>
              <li><a href="#">Interests</a></li>
              <li><a href="#">Other</a></li>
          </ul>
        </div>
    </div>
  </div>

I added the class of logo to the "Gareth Edwards CV" link in the top right hand side of my page. In my-styles.css I attempted to over-ride the colour by using the folling css

.logo {
    color: white;
}

This doesn't work so I also tried targeting the .navbar-inverse, .navbar-brand classes using the same CSS but to no avail. I can see in the chrome development tools' elements section that the CSS being applied to the logo is :

.navbar-inverse .navbar-brand {
     color: #999;
}

Can anyone tell me how to over-ride the twitter bootstrap navbar classes without changing the bootstrap.min.css file?

Any help would be greatly appreciated. Thanks

2 Answers

Realised I wasn't targeting the classes correctly by incorrectly using a comma to separate classes.

hey Gareth so do you mean you had before :

.navbar-inverse, .navbar-brand { color: #999; }

i ask because i want to do the same to my bootstrap navbar