O'Reilly logo

CSS Master by Tiffany B Brown

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7 Applying CSS Conditionally

As its name suggests, conditional CSS refers to CSS rules that are applied when a condition is met. Conditional CSS consists of conditional grouping rules, and the rule sets nested within. A condition in this context may be a CSS property and value combination, as with the @supports rule. A condition may test for a browser window condition such as width, as with the @media rule. Or a condition may be a device feature such as hover state or pointer input, also as with @media. We'll discuss all this in the chapter.

Both @media and @supports are described by the CSS Conditional Rules Module, Level 3 specification. The @media rule—which you probably know as media queries—is fully defined by the Media Queries ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required