Pseudo classes are bolted on to selectors to specify a state or relation to the selector. They take the form of selectorseudo class { property: value; }, simply with a colon in between the selector and the pseudo class.

Many CSS proposals are not supported by all browsers, but there are four pseudo classes that can be used safely when applied to links.

  • link is for an unvisited link.
  • visited is for a link to a page that has already been visited.
  • active is for a link when it is gains focus (for example, when it is clicked on).
  • hover is for a link when the cursor is held over it.

Code:
a.snowman:link {
	color: blue;
} a.snowman:visited {
	color: purple;
}
a.snowman:active {
	color: red;
}
a.snowman:hover {
	text-decoration: none;
	color: blue;
	background-color: yellow;
}
Traditionally, text links were blue if not visited and purple
if visited, and there is still reason to believe that these are the
most effective colours to use, although, again, with the increasingly
widespread use of CSS, this is becoming less commonplace and the
average user no longer assumes that links must be blue or purple.
You should also be able to use the hover pseudo class with
elements other than links. Unfortunately, Internet Explorer doesn't
support this method. This is a bloody irritation because there are lots
of nice little tricks you can do that look delightful in other browsers.