:visited (CSS selector)

Spec
Version
CSS1
Browser support (more…)
IE7+ FF1+ SA1.3+ OP9.2+ CH2+
Full Full Full Full Full

Syntax

:visited {
declaration block
}

Description

This pseudo-class matches link elements that are determined to have been visited.

In CSS1, this pseudo-class applied only to a elements that had an href attribute (that is, a hypertext link). In CSS2, the document language can define elements as hyperlink anchors. It’s up to the user agent to decide which links it considers to be visited and unvisited.

The two pseudo-classes :link and :visited are mutually exclusive: a link is either visited or unvisited. As such, a selector like a:link:visited should never match any element.

Example

This rule will set the font color of all visited HTML links to #cccccc:

a:visited {
  color: #cccccc;
}

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Buggy Buggy Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full

Neither Internet Explorer 5.5 nor 6 supports the chaining of pseudo-classes; only the last pseudo-class is honored in these browsers.

User-contributed notes

Related Products