CSS :link pseudo-class

CSS :link Pseudo-Class

Description

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

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

  • a:hover must appear 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 used in conjunction with them.

Possible Values

  • color – Any valid color value.

Applies to

Anchor/Link elements.

Example

The following example demonstrates how to use the :link class to set the link color.

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

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

This will produce the following black link −

CSS :link pseudo-class

Leave a Reply

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