CSS Links
To style links you use the a selector (anchor) and the following pseudo-classes. When you use pseudo classes you use the semi-colon after the selector. Pseudo classes are IDs which the browser applies to elements, and can save you time when making classes of every type of link.
Pseudo Classes | Description |
---|---|
:link | Styles a unvisited link |
:visited | Styles a visited link |
:active | Active link (when you click on it) |
:hover | When you point your mouse cursor over it |
It must be done in this order, otherwise it will not work.
The common way of styling links is to change the fore-colour so it stands out and to underline it; by default, links are underlined. If you don’t want them to be underlined, use text-decoration:none;.
a:link {color: #EEE;} a:visited {color: #000;} a:active {color: #33CCFF;} a:hover {text-decoration:none;}