Chapter 1. Cascade, specificity, and inheritance

This chapter covers

  • The four parts that make up the cascade
  • The difference between the cascade and inheritance
  • How to control which styles apply to which elements
  • Common misunderstandings about shorthand declarations

CSS is unlike a lot of things in the world of software development. It’s not a programming language, strictly speaking, but it does require abstract thought. It’s not purely a design tool, but it does require some creativity. It provides a deceptively simple declarative syntax, but if you’ve worked with it on any large projects, you know it can grow into unwieldy complexity.

When you need to learn to do something in conventional programming, you can usually figure out what to search ...

Get CSS in Depth 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.