Specifying media-dependent style sheets

There are currently two ways to specify media dependencies for style sheets:

Specify the target medium from a style sheet with the @media or @import at-rules.
Example(s):


@import url("loudvoice.css") aural;
@media print {
/* style sheet for print goes here */
}

Specify the target medium within the document language. For example, in HTML 4.0 ([HTML40]), the "media" attribute on the LINK element specifies the target media of an external style sheet:




Link to a target medium
media="print, handheld" href="foo.css">


The body...



The @import rule is defined in the chapter on the cascade.

7.2.1 The @media rule
An @media rule specifies the target media types (separated by commas) of a set of rules (delimited by curly braces). The @media construct allows style sheet rules for various media in the same style sheet:

@media print {
BODY { font-size: 10pt }
}
@media screen {
BODY { font-size: 12pt }
}
@media screen, print {
BODY { line-height: 1.2 }
}