STYLIN??™ WITH CSS - CHAPTER 2 48
By the way, this rule would also select this example

alt="Dartmoor " />
even though this example??™s alt tag doesn??™t have the hyphenated
extension to the value.
Figure 2.16 is a screenshot in Firefox displaying these code examples.
FIGURE 2.16 Firefox correctly displays attribute selectors. The title tags of the
images are the same as the alt tags shown in the screenshot??¦
FIGURE 2.16A. ??¦but IE 7 has no
attribute selector capabilities.
Summary of Selectors
So far, you??™ve seen that you can target CSS rules in several ways: by
using tag selectors, by using class and ID selectors, by using selectors
that are a combination of both, and even by selecting based on
the attributes that are attached to the tag.
One common aspect of these selectors is that they all are targeting
something in the markup??”a tag name, a class, an ID, an attribute,
HOW CSS WORKS 49
or an attribute value. But what happens if you want some kind of
styling to happen when some event occurs, such as the user pointing
at a link? In short, you want a way to apply rules based on events.
And after all this buildup, you know I??™m going to tell you there??™s a
way to do that.
Pseudo-Classes
Named for the fact that they are classes that aren??™t actually attached
to tags in the markup, pseudo-classes cause rules to be applied to
the markup when certain events occur.
Pages:
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81