HTML and CSS Reference
In-Depth Information
er , and :visited pseudoclasses for the hyperlink tag ( <a> ), as well as
:first-child . Even though you may use :active for other elements,
none of the browsers yet supports applications beyond the <a> tag.
8.3.5. Mixing Classes
Mix pseudoclasses with regular classes by appending the pseudoclass
name to the selector's class name. For example, here are some rules
that define plain, normal, and fancy anchors:
a.plain:link, a.plain:active, a.plain:visited {color: blue}
a:link {color: blue}
a:visited {color: green}
a:active {color: red}
a.fancy:link {font-style: italic}
a.fancy:visited {font-style: normal}
a.fancy:active {font-weight: bold; font-size: 150%}
The plain version of <a> is always blue, no matter what the state of
the link is. Accordingly, normal links start out blue, turn red when act-
ive, and convert to green when visited. The fancy link inherits the color
scheme of the normal <a> tag, but italicizes the text for unvisited links,
converts back to normal text after being visited, and actually grows 50
percent in size and becomes bold when active.
A word of warning about that last property of the fancy class: specifying
a font-size change for a transient display property results in lots of
browser redisplay activity when the user clicks the link. Given that some
browsers run on slow machines, this may not be visually refreshing for
your readers. Given also that implementing that sort of display change
is something of a pain, it is unlikely that most browsers will support rad-
ical appearance changes in <a> tag pseudoclasses.
Search WWH ::

Custom Search