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

pseudo class???

What is pseudo class , i didn't get it well in video lecture usng "nav a" css rule ???

2 Answers

One of the easiest explanations of Pseudo Class, is using color with links or Link Pseudo Classes.

For example, If I create a link to an external web site, I can write code that makes it the color blue if nobody has clicked and visited it yet. (for example, If someone has not yet clicked the link, the linked text will remain blue. CSS Code - a:link {color: blue;}

Once somebody actually clicks the link, then the css code will change that link to the color purple CSS Code - a:visited {color: purple;}

a:link is telling it to make the link blue if no action has been taken. Once the action is executed,(link clicked and visited) then that same link text changes to purple.

Think of it as before action, then after action results. Pseudo Classes can change with actions such as hovering a mouse arrow over a link. If you want to include keyboard users that don't have a mouse, then there is a class called focus. That is where you would most likely just make the a:focus the same color as the a:hover.

Some of the Link Pseudo Classes: Link, Visited, Hover, Active and Focus for keyboard users who don't use a mouse.

As far as the "nav a" is concerned, this is where you are creating control of different colors and styles, inside of the navigation menu itself. Nav tells the browser to apply the style to all "a"'s within the navigation menu.

Thanks for your kindly replay, got the idea clearly .

You are welcome!

Lusako Njwaba
Lusako Njwaba
1,064 Points

Thanks Mark for the explanation.