CSS At-rules

At-rules are instructions or directives to the CSS parser. They can be used for a variety of purposes.

The @charset at-rule can be used to specify the character encoding of an external style sheet. It must appear before anything else in the file.

The @import at-rule allows us to import one style sheet into another. All @import at-rules must appear before any rules.

The @media at-rule lets us target rules to the media types we specify.

The @page at-rule can be used to specify margins for paged media. You can set different margins for left- and right-hand pages when you’re printing double-sided pages, as well as for the first page.

The @font-face at-rule allows us to specify custom fonts.

The @namespace at-rule in CSS3 lets us declare an XML namespace, as well as an optional prefix with which that namespace can be specified.

In this Section

User-contributed notes

ID:
#1
Contributed:
by mattymcg
Date:
Thu, 17 Jan 2008 03:41:46 GMT
Status:
This note has not yet been confirmed for accuracy and relevance.

1. Should these bullet points include the @ ?
2. "defines custom font properties" is a little ambiguous. Does it define custom properties, or properties for a custom font? (I suspect the latter)

Related Products