Prev | Current Page 129 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

The most commonly
desired behavior for links is as follows:
a:link {
?‹® declarations
}
a:visited {
?‹® declarations
}
a:focus {
?‹® declarations
}
a:hover {
?‹® declarations
}
a:active {
?‹® declarations
}
Dynamic Pseudo-class Mnemonics
Several mnemonics have been devised to help us remember this order, including
???LoVe Frogs HAppy,??? ???Las Vegas Fights Hell??™s Angels,??? and??”for the Star Wars
fans??”???Lord Vader, Former Handle Anakin.???
The :link and :visited pseudo-classes should generally come first.5 Next should
be :focus and :hover??”they??™re specified now so that they override and apply to
both visited and unvisited links. If :focus precedes :hover, the hover effect will
apply to links with keyboard input focus. The :active pseudo-class should always
come last, since we usually want to indicate clearly any links that have been
activated.
This isn??™t the only useful order, nor is it in any way the ???right??? order. The order in
which you specify your pseudo-classes will depend on the effects you want to show
with different combinations of states.


Pages:
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141