Chapter 12. Style Sheets for Printing

CSS lets you create specialized style sheets that control how Web pages are printed. These need not be anything like the screen version of the style sheets for that page. For example, you might want to remove extraneous sidebars or advertisements from a print version.

Using Media-Specific Style Sheets

You can designate a style sheet to be used only when printing, only on screen, or for both print and screen. 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 ...

Get HTML for the World Wide Web, Fifth Edition, with XHTML and CSS 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.