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 ...

Get CSS in Depth now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.