The :link, :visited, and :active Pseudo-Classes

The :link, :visited, and :active pseudo-classes let you set the style of A elements based on the current state of the links. In a selector, you use these pseudo-classes with the A element in the same way you would use class identifiers.

A:link { color: red } /* unvisited link */

A:visited { color: blue } /* visited links */

Unlike class identifiers, you do not use the pseudo-classes with the CLASS= attribute. Instead, the browser automatically interprets which pseudo-class to use based on the state of the link.

You can combine pseudo-classes with normal classes.

A.external:visited { color: blue }

If the URL specified by an A element having the external class (defined above) has been visited, it displays in blue. Note that normal class identifiers must precede the pseudo-class in the selector.

You can apply pseudo-classes to nested element names, just as with class identifiers.

A:link IMG { border: solid blue }

Using pseudo-classes on elements other than the A element has no effect.

Ayuda de Html para Javascripts.astalaweb.com.