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 Organize CSS with Comments

full stop or colon in CSS .selected vs :hover

Very simple question! Why does the .selected psuedo-class use a full stop whereas the :visited and :hover selectors use colons? thanks very much, rob

3 Answers

Dave McFarland
Dave McFarland
Treehouse Teacher

Hi Robert Grieg-Gran

In this video, .selected isn's a pseudo-class, it's a regular class selector that's been applied to one of the links on the index.html page.

But, there is a ::selection pseudo-element (thanks James Barnett) that applies when content on a page is selected by a user: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements

James Barnett
James Barnett
39,199 Points

Dave McFarland -

:selected isn't listed on the mdn page you linked.

However there is a pseudo-element ::selection


got it thanks vm