stylinwithcss.com/stylib.
The distinctive : (colon) in the
selector screams (well, indicates)
???I am pseudo-class!???
STYLIN??™ WITH CSS - CHAPTER 2 50
First, let??™s save the debate about appropriate link colors and behavior
for later and simply observe that, according to the declarations
above, links are initially black (and underlined by default). When the
mouse rolls over them (the hover state), the underlining is removed,
and they stay black, because no color is de?¬? ned here for the hover
state. When the user holds the mouse down on the link (the active
state), it turns navy, and forever after (or more accurately, until the
browser??™s history of the visit to the link??™s URL expires or is deleted by
the user), the link displays in gray. When using these pseudo-class
selectors, you have complete control over the look and behavior of
the four states of links.
And that??™s all very nice, but the real power comes when you start
using these anchor link pseudo-classes as part of contextual selectors.
Then you can create different looks and behaviors for various
groups of links in your design??”navigation, footers, sidebars, and
links in text, for example. We??™ll explore using these pseudo-classes
for styling of links and other things to the point of tedium (or perhaps,
ecstasy) later in the book, but for now, let??™s note the following
and then move on:
You don??™t have to de?¬? ne all four of these states.
Pages:
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83