CSS :visited pseudo-class

CSS :visited pseudo-class

Description

The :visited pseudo-class is used to add special effects to visited links.

When defining pseudo-classes within a block, keep in mind the following:

  • a:hover must be placed after a:link and a:visited in the CSS definition to take effect.

  • a:active must be within CSS definition to take effect.

  • Pseudo-class names are case-insensitive.

  • Pseudo-classes are distinct from CSS classes, but can be combined.

Possible Values

  • color − Any valid color value.

Applies to

Anchor/Link elements.

Example

The following is an example showing how to set the link color using the :link class.

<html> 
<head> 
<style type = "text/css"> 
a:link {color:#000000} 
</style> 
</head> 

<body> 
html/index.htm">Black Link
</body>
</html>

This will generate the following black link −

CSS :visited pseudo-class

Leave a Reply

Your email address will not be published. Required fields are marked *