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 trialRichard Owens
1,071 PointsI dont understand what nav a:visited code does to make the links turn white. Can someone explain it?
nav a:visited
2 Answers
Blake White
5,232 PointsHe combines two things in one, and uses something you have not seen before in this video. Here is how it works.
nav a, nav a:visited {
color: #fff;
}
is the equivalent of
nav a {
color: #fff;
}
nav a:visited {
color: #fff;
}
You can change the color value of either in the second one to help clarify what is happening. Your browser has a default style for visited links, usually a darker purple color. We are overriding that with the a:visited, but only for the anchors within the nav tags.
Let me know if that doesn't clear it up enough.
Nate Conley
16,191 PointsThe visited pseudo-class in CSS is triggered when you have visited a link. If, in your CSS, you set that element to white, it will turn white after you have, in fact, clicked on it, and visited the page.