CHAPTER 13

image

Using Advanced Selectors

Chapter 2 introduced you to the 16 most commonly used selectors. Along the way, you’ve also been introduced to two more: the :first-child pseudo-class and the child selector. In this chapter, it’s time to get up to speed with the remaining CSS3 selectors. There are another 24 in the CSS3 Selectors module, and even more have already been proposed for CSS4. You might be wondering why so many selectors are needed.

A fundamental principle behind CSS is the separation of content from presentation. If you rely all the time on using classes or ID selectors to mark up how your web pages should be presented, the separation ...

Get Beginning CSS3 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.