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

HTML How to Make a Website Customizing Colors and Fonts Use Color in CSS

Nav Header will not change color!

For some reason in my CSS markup I cannot get my Nav Header to change color. I have my header element and another element below that is a black bar with my navigation list items (Portfolio, About, Contact). I want this to be the same color as my header but no matter what I do it just remains black.

Also I can't seem to figure out the margin or padding issue with the Nav header. It seems to cut off and will not extend the full length of the page.

Can someone please help? Thank you so much.

2 Answers

To extend your nav header all the way, you need to remove the margin-right: 5%; from the nav media queries and make sure that the background color is cascading correctly for the different media queries or is consistent if it's always going to be the same colour.

Right now this is overriding all your styles:

@media screen and (min-width: 660px)
nav {
    background: #000;
    float: right;
    font-size: 1.125em;
    margin-right: 5%; 
    text-align: right;
    width: 100%;
}

Hope that helps :)

Wow - That worked. Thank you so much :)

Vance Rivera
Vance Rivera
18,322 Points

There is a lot going on this portfolio site you are creating. I took a brief look at the project and it seems like you are going in the right direction but it's a little unorganized. First issue i have found is that you are targeting and styling the nav element at least three times over two separate css files. I know one of the css rules is confined within a media query so that is fine but I would suggest especially for a project this small is to write your css code all into one file until you get more comfortable with the organization then start breaking your code out however you want.(just a suggestion). From what I have looked at is that you need to set the width of your nav to 100%. at this point you can either expand the ul full width of the nav or you can wrap your ul with a .wrapper and center align the .wrapper to compact the navigation item to the middle of the screen. As for the background color of the nav you have a rule set in responsive.css targeting media query min-width 660px that changes the existing background color. Hope this helps. Let me know if you have any more issues.Cheers!

Hi Vance,

Just want to say thank you so much for your help. I am not sure how my code got so unorganized but I can now see what you were talking about. I was able to fix my NAV element and get it to change to the color i wanted. Thanks so much!