:link

Summary

The :link CSS pseudo-class lets you select links inside elements. This will select any link, even those already styled using selector with other link-related pseudo-classes like :hover, :active or :visited. In order to style only non-visited links, you need to put the :link rule before the other ones, as defined by the LVHA-order: :link:visited:hover:active. The :focus pseudo-class is usually placed right before or right after :hover, depending of the expected effect.

Examples

a:link {color: slategray;}
.external:link {background-color: lightblue;}

Specifications

Specification Status Comment
Selectors Level 4 Working Draft No change.
Selectors Level 3 Recommendation No change.
CSS Level 2 (Revision 1) Recommendation Lift the restriction to only apply it for <a> element.
CSS Level 1 Recommendation Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1 1.0 (1.7 or earlier) 3.0 3.5 1.0
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 1.5 1.0 (1.9.2) ? ? 3.2

See also

Document Tags and Contributors

Last updated by: tregagnon,
Hide Sidebar