9. Defining Selectors
In This Chapter
Selecting Elements by Class or ID
Selecting Links Based on Their State
Selecting Elements Based on Attributes
As you saw in “Constructing a Style Rule” in Chapter 7, there are two principal parts of a CSS style rule. The selector determines which elements the formatting will be applied to, and the declarations define just what formatting will be applied. In this chapter, you’ll learn how to define CSS selectors.
While the simplest selectors let you format all the elements of a given type—say, all the h1 headings—more complex selectors ...
Get HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition 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.