CSS :linkSelectors

Complete CSS Selector Reference Manual

Example

Choose unvisited link style:

a:link
{
background-color:yellow;
}

Try it Yourself »

Definition and Usage

:link adds special styles to unvisited links.

Note:The :link selector does not apply styles to already visited links.

Tip:Usage:visitedThe selector sets styles for visited page links,:hoverThe selector styles links when a mouse hovers over them,:activeThe selector sets styles for when you click on a link.


Browser Support

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

Selectors
:link 4.0 7.0 2.0 3.1 9.6

Related Pages

CSS Tutorial:CSS Links

CSS Tutorial:CSS Pseudo classes


Examples

More Examples


Example

Active, visited, unvisited, or links with 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 »


CSS element,elementSelectors

Complete CSS Selector Reference Manualother extensions