CSS :visitedSelectors

Complete CSS Selector Reference Manual

Example

Select the style for visited links:

a:visited
{
background-color:yellow;
}

Try it Yourself »

Definition and Usage

:visited adds special styles to visited links.

Tip:Use the :visited selector to set styles for visited page links,:hoverthe selector for the style of links when the mouse hovers over them,:activethe selector sets the style for when you click a link.


Browser Support

The numbers in the table indicate the first browser version number that supports that property.

Selectors
:visited 4.0 7.0 2.0 3.1 9.6

Related Articles

CSS Tutorial:CSS Links

CSS Tutorial:CSS Pseudo-classes


Examples

More Examples


Example

Links that are active, visited, unvisited, or have a mouse hovering over them:

a:link    {color:green;}
a:visited {color:green;}
a:hover   {color:red;}
a:active  {color:yellow;}

Try it Yourself »

Example

Link styles for different states:

a.ex1:hover,a.ex1:active {color:red;}
a.ex2:hover,a.ex2:active {font-size:150%;}

Try it Yourself »


Complete CSS Selector Reference Manual

other extensions