Combining Selectors

You can combine any of the techniques that I’ve explained in the last few pages in order to pinpoint the elements that you’re interested in formatting.

To combine selectors:

1.
Define the context of the desired element. For more details, consult Selecting Elements by Context on page 141.
2.
Next, either spell out the element’s name (see page 139) or use the wild card character (see page 139).
3.
Then, specify the class or id of the desired element(s). For more details, consult Selecting Elements by ID or Class on page 140.
4.
Next, specify the pseudo-class or pseudo-element. For more details, consult Selecting Part of an Element on page 144 and Selecting Link Elements Based on Their State on page 146.
5.
Finally, specify ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.