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 trialDaniel Coulter
2,936 PointsSelected 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.
2 Answers
Anthony Mejia
8,840 PointsYour CSS seems fine. My suggestion would be to make sure your a tags are properly formatted with the selected class.
Sergey Podgornyy
20,660 PointsUse 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
Austin Whipple
29,725 PointsAustin Whipple
29,725 PointsI 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.