142
Use Pseudo-Classes ...............................................
2 Within the style sheet, type
a:link.
3 Press.
4 Type {.
5 Type the styles you want to
apply to the link.
6 Press.
7 Type }.
1 In your editor, open a page
that contains an embedded
style sheet.
Use Pseudo-Classes
A
pseudo-class can apply a style to an element based on its current state. The most commonly used
pseudo-classes are used to style links in their five common states: normal, visited, hover, active,
and focus. The a:link pseudo-class applies a style to a link in its normal state. The a:visited
applies when you have visited the target of the link. The a:hover applies when the user mouses
over the link, and a:active should apply when the link is selected — for example, when you are
pressing your mouse down on it. Finally, a:focus defines a style to be shown when is used to
navigate the page.