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
- charset
used to specify the character encoding of an external style sheet - import
a mechanism for importing one style sheet into another - media
specifies that one or more rule sets in a style sheet will apply only to certain media types - page
specifies margin values for the page box in style sheets for paged media - font-face
defines custom font properties - namespace
declares an XML namespace in CSS3
User-contributed notes
- ID:
- #1
- 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)