@media

The CSS   @-rule is used to specify that one or more rule sets in a style sheet will apply only to certain media types. This at-rule must be followed by a comma-separated list of media types and a block that contains rules.

In the example below, the first set of rules will be applied only for screen and projection media. The second set of rules will be applied only when the document is printed or viewed in print preview mode:

@media screen, projection { html { background:#FFFEF0; color:#300; } body { max-width:35em; margin:0 auto; } }

@media print { html { background:#FFF; color:#000; } body { padding:1in; border:0.5pt solid #666; } }