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 How to Make a Website Customizing Colors and Fonts Use Color in CSS

I am trying to apply a different color to the nav element in the header, but it won't change color.

I typed the same code which was given, only slightly changing the actual color.

nav a, nav a:visited {color: #fff0ff;}

6 Answers

Sage Elliott
Sage Elliott
30,003 Points

The portion of the CSS you posted looks correct to me. It's possible there could be an error somewhere else in the code. I will often forget a semicolon or bracket somewhere that can mess up the rest of the code. I've also forgotten to save the file before...haha.

Well, I did realize that I had placed the class="selected" in the wrong part of the html, but it doesn't seem to have changed anything.

Wait.....

I noticed a single missing bracket that wasn't allowing any code after it to apply. Thanks for the help!

Sage Elliott
Sage Elliott
30,003 Points

Would you mind posting the code so we could take a look and see what happened?

The same thing just happened with another bit of code, and I noticed that the text is blue instead of black.

Sage Elliott
Sage Elliott
30,003 Points

Looks like you may have a typo in your pseudo class tag. You have "nag" instead of "nav". Try fixing that and see if it works.

Woops, that was just autocorrect in the comment. I have "nav a" in the actual code.

Sage Elliott
Sage Elliott
30,003 Points

Anytime! Debugging is just part of the process and can definitely be frustrating, especially at the beginning! We all make those mistakes and you'll quickly learn the common ones.