We conclude our selection on CSS properties with the introduction of some pseudo-classes, typically but not solely used with <a>
, the anchor tag. The anchor tag is used mainly for links. To make it visible that they are indeed links, the default styling of <a>
happens to be a blue color and the text is underlined, which is not very attractive.
Using pseudo-classes, you can give an anchor tag, in theory any tag, a different look depending on where the cursor is, relative to the link and whether or not the link has already been visited. Here is an example:
a:link { text-decoration:none; /* switches off the underline */ } a:hover { color:white; /* changes color to white when the curser hangs over it (hover) */ } a:visited { color:yellow; /* changes the color to indicate that you already visited that link */ }