1. Home
  2. Computing & Technology
  3. Web Design / HTML

What is a CSS Pseudo-Class Selector?

By , About.com Guide

The CSS pseudo-class selectors are selectors that are based on some other attribute beyond the element's name, attributes or content. The pseudo-class selectors are:

  • :active matches on active links.
  • :first-child matches on the first child of the element.
  • :focus matches when the element has focus.
  • :hover matches when the element is hovered over by the mouse.
  • :lang matches on the language of the document.
  • :link matches unvisited links.
  • :visited matches visited links.

To remove the underlines from links once they have been visited:

a:visited {
text-decoration : none ;
}

Or to match the first child element of a div, no matter what element it was:

div:first-child {
border : 1px solid blue ;
}
Explore Web Design / HTML
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. CSS Selectors
  6. CSS Pseudo-Class Selectors - What is a CSS Pseudo-Class Selector>

©2009 About.com, a part of The New York Times Company.

All rights reserved.