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

Dhanur Grandhi
Dhanur Grandhi
912 Points

Question regarding pseudo class

Instead of, nav a, nav a:visited { color: #fff; }

could we also have done this to apply visited links style to the whole site? a, a:visited { text-decoration: none; color: #fff; }

2 Answers

Yes it definitely can, you can start with giving you links global styles and then style the ones you want specifically. See here:

a{
   color: red;
} 

a:hover{
   color: blue;
} 

a:active{
   color: green;
} 

a:visited{
   color: white;
} 

/****   nav specific styles   ****/

nav a{
   color: red;
} 

nav a:hover{
   color: blue;
} 

nav a:active{
   color: green;
} 

nav a:visited{
   color: white;
} 
Dhanur Grandhi
Dhanur Grandhi
912 Points

Awesome, thank you! I will use markdown to post code snippets from now on :)