C H A P T E R  1

Design Patterns: Making CSS Easy!

On the surface, CSS seems easy. It has 45 commonly used properties you can employ to style a document. Below the surface, different combinations of properties and property values trigger completely different results. I call this CSS polymorphism because the same property has many meanings. The result of CSS polymorphism is a combinatorial explosion of possibilities.

Learning CSS is more than learning about individual properties. It is about learning the contexts in which properties can be used and how different types of property values work differently in each context. As an example, take the width property, which has many different meanings depending on how it is combined with other rules and ...

Get Pro HTML5 and CSS3 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.