Skip to: content, navigation

by Tommy Olsson and Paul O’Brien

At-rules Reference

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
Date:
Thu, 17 Jan 2008 03:41:46 GMT
Contributed by:
mattymcg
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)

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters