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 Adding Pages to a Website Add Iconography

Selected page

I cannot seem to find out why my code isn't working for the selected page change in color. My pages seem to stay white, even when I am on the selected page.

This is the code I have at the bottom of the main.css:

nav a.selected, nav a:hover { color: #32673f; }

Please help.

Austin Whipple
Austin Whipple
29,725 Points

I agree with Anthony below, the CSS included appears valid. If the problem persists, including a bit more of the CSS as well as the HTML of the page may help others diagnose the issue.

2 Answers

Your CSS seems fine. My suggestion would be to make sure your a tags are properly formatted with the selected class.

Sergey Podgornyy
Sergey Podgornyy
20,660 Points

Use pseudo-classes for this purpose:

nav a:active, nav a:hover { 
   color: #32673f; 
}

Read more about pseudo-classes here - http://www.w3schools.com/css/css_pseudo_classes.asp