Example
This example will set the font color
of all unvisited HTML links to #cccccc:
a:link {
color: #cccccc;
}
Description
This pseudo-class matches link elements that are determined to be unvisited.
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.
Compatibility
| IE | 5.5 | Buggy |
|---|---|---|
| 6.0 | Buggy | |
| 7.0 | Full | |
| Firefox | 1.0 | Full |
| 1.5 | Full | |
| 2.0 | Full | |
| Safari | 1.3 | Full |
| 2.0 | Full | |
| 3.0 | Full | |
| Opera | 9.2 | Full |
| 9.5 | 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
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

