CSS/Selectors/pseudo-classes/:visited

From Web Education Community Group
< CSS‎ | Selectors
Revision as of 18:50, 21 November 2011 by Rworth (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Pseudo-classes :visited

The :visited pseudo-class applies once the link has been visited by the user.

Syntax

selector:visited{ properties }


Example

[style.css]

 a:link{
   color: red;
 }
 a:visited{
   color: green;
 }


[index.html]

<body>
  <p><a href="http://www.w3.org/">W3C</a> is an international community</p>
</body>

Css3 selectors dyn visited.png

CSS defines the :visited pseudo-class in 6.6.1. Dynamic pseudo-classes.