CHAPTER 3CSS Selectors and Inheritance

This chapter presents design patterns that select elements for styling.

Because selector design patterns are simple, I discuss selector design patterns in groups rather than one at a time. This makes it easy to compare and contrast related forms of selectors. Thus, even though this chapter has only six examples, it contains thirteen different design patterns.

Inheritance is included in this chapter because it is simply a built-in way to select descendant elements. Inheritance is very closely related to the descendant selector. The Visual Inheritance pattern is included in this chapter because it is a form of inheritance that is visual by nature.

Chapter Outline

  • Type, Class, and ID Selectors show how to ...

Get Pro CSS and HTML Design Patterns 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.