Using Media-Specific Style Sheets

You can designate a style sheet to be used only for a particular output, perhaps only for printing, or only for handhelds. For example, you might create one general style sheet with features common to both the print and screen versions, and then individual print and screen style sheets with properties to be used only for print and screen, respectively.

To designate media-specific style sheets:

Add media="output" to the opening link or style tags, where output is one or more of the following: print, screen, handheld, or all (Figure 8.17). Separate multiple values with commas.

Figure 8.17. Limit the style sheet to a particular output by adding the media attribute to the link element.

Or, in an @import rule, ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.