CSS - at (@) rules

CSS at-rules are directives (instructions) to the CSS compiler. ref.

Directive Description & Example

Sets the character set encoding for this file.

@charset = "iso-8859-1";

Use to load custom fonts.

@font-face {
 font-family: "MyFont";
 src: url("webfont.eot");

Reference the new font as usual:

body {
 font-family: "MyFont";

Use to import another CSS file.

 @import "default.css";
Use to declare media type specific CSS rules.
@media print
body {
 background-color: white;

Use to change the default namespace, or declare a new namespace.


Use to configure the page for printed output.

@page {
 size: 8.5in 11in;
 margin: 4em;

 @top-left {
  content: "Report";
 @top-right {
  content: "Page " counter(page);

Ads by Google

Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath