active
hover
visited
PSEUDO-CLASSES: link
link
Compatibility:
IE4+ N6+
Version:
Level 1
The
link
pseudo-class is used to apply style to a link that is unvisited. In other words, the link has not been clicked upon or visited by the user. (Note: the fact that a link has been visited is stored in the browser history. If the history is plurged, the fact that the link has been visited may be lost and the link will be treated as unvisited.)
All together, there are four pseudo-classes that are reserved for use with the HTML anchor tag (
a
). They are used to assign any appropriate CSS property:value pair to a link. Most typically, they are used to designate a font color, or background color, or to remove the underline.
The three other pseudo-classes used with the
a
tag are:
active
The
active
pseudo-class effects a style when the link is selected (clicked on).
hover
The
hover
pseudo-class effects the style when the mouse is hovering over the link (mouse over).
visited
The
visited
pseudo-class effects the style for a link after the link has been visited.
A pseudo-class is assigned to a selector via following syntax:
selector:pseudo-class { property: value; ...; }
A pseudo-class can also be used with the value assigned as a class to a selector:
selector.class:pseudo-class { property: value; ...; }
Code:
a:active { background-color: RGB(100, 14, 107); text-decoration: none; }
a:hover { color: red; text-decoration: none; }
a:link { color: teal; text-decoration: none; }
a:visited { visibility: hidden; }
or
a.example:link {
color: blue; background-color: red; text-decoration: none;
}
a.example:visited {color: yellow; text-decoration: none;}
<a class="example" href="http://www.facade.com/biorhythm" target="_blank">Biorythem</a>
Output:
Biorythem
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information