A.1. At-Rules

The CSS2 recommendation from the W3C defines a new type of CSS rule. It's called an "at-rule" because all the rules of this type start with an "at" sign (@). This type of rule is meant to be extensible. In other words, future editions of the W3C recommendation, browser developers, and others may define new sets of rules that begin with @.

For now, there are four groups of @ rules:

  • @import

  • @media

  • @page

  • @font-face

The @import rule is discussed in Chapter 12.

The @media rule allows you to define different output options for various media in a single style sheet. Browser support is somewhat inconsistent, though it seems to be getting better with each release. Right now, support for this rule is at least usable in most modern browsers ...

Get HTML Utopia: Designing Without Tables Using CSS 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.