Prev | Current Page 58 | Next

Charles Wyke-Smith

"Stylin' with CSS: A Designer's Guide 2nd Edition"

8).
FIGURE 2.8 A child selector provides
the required context to select
the word ???speci?¬? c??? in this markup.
Before you drop this book in your haste to start using child selectors
in your CSS, it??™s important to know that, at the time of writing,
IDWIMIE6; Internet Explorer for Windows 6 simply ignores them
(although Internet Explorer 7 for Windows does implement them).
However, there are work-arounds if you ?¬? nd yourself in situations
where only a child selector will do. As you will see shortly, classes
and IDs let you target any individual tag you want, but to use them,
you??™ll need a little extra markup.
So until Internet Explorer 6 becomes insigni?¬? cant in usage,
you??™ll mainly use child selectors to create variations in your style
sheet to work around Internet Explorer??™s various nonstandardscompliant
quirks, or in ways that cause IE6 to display a different
but still acceptable result. We will use them in this way in later
chapters.
The > symbol is used between the
two selectors to mean ???child of.???
HOW CSS WORKS 39
Adding Classes and IDs
So far you??™ve seen that when you have a rule with a selector that
simply states a tag name such as p or h1, the rule is applied to every
instance of that tag. You??™ve also seen that to be more speci?¬? c in the
selection process, you can use contextual selectors to specify tags
within which target tags must be contained.


Pages:
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70