Prev | Current Page 230 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

This is because certain states override others, and those
???closest??? to the link on the web page take precedence.
There is debate regarding which order the various states should be in, so I can only provide
my reasoning for this particular example. It makes sense for the link to be a certain
color when you hover over it, and then a different color on the active state (when
clicked), to confirm the click action. However, if you put the hover and active states in
the other order (active, hover), you may not see the active one when the link is clicked.
This is because you??™re still hovering over the link when you click it.
The focus state is probably primarily use keyboard users, and so they won??™t typically see
hover anyway. However, for mouse users, it makes logical sense to place focus after hover,
because it??™s a more direct action??”in other words, the link is selected, ready for activation
THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
156
during the focus state; but if you ordered the states focus, hover, a link the cursor is
hovering over would not change appearance when focused, which from a user standpoint
is unhelpful.
However, there is a counter argument that recommends putting focus before hover, so
that when an already focused link (or potentially any other focused element for non-IE
browsers) is hovered over, it will change from the focused state to indicate that it is now
being hovered over. Ultimately, this is a chicken-and-egg scenario??”do you want a hovered
link to change from hover to focus to active? The focus will get lost somewhere in there
until the link is depressed (and the active state removed), by which time the link will be
in the process of being followed.


Pages:
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242