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

Joshua Kanui-Rowe
Joshua Kanui-Rowe
1,812 Points

Why dose have to put "nav a, nav a" twice to make it stay white when "visited"?

I am confused why we have to put "nav a, nav a" twice to make it stay white in the code "nav a. nav a.visited"?

1 Answer

If you'd just write 'nav a.visited' you would only style the links you visited, and not the links in general. So if you haven't visited a link yet, the styling doesn't apply to it and you'll get the default styling. By selecting "nav a, nav a.visited" you select a) Links in the <nav> section in general and b) Links in the <nav> section that were already visited.