13.07.2015 Views

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 13: Styling <strong>for</strong> Print}}display: none;4. Save the preceding document as Example_13-1.css. Figure 13-3 shows the rendered output inSafari, and the print preview.Figure 13-3How It WorksIn Example 13-1, you made use of the media attribute and the @media rule. In the XHTML document, youincluded an external style sheet via the element, and on the element you included theattribute media=’all’, which tells the browser that the style sheet applies to all media. Insofar as your PCor Mac browser is concerned, that means the styles apply to both print and screen media.Within the style sheet, you see the style sheet divided into three parts: portions that apply to all media, rulesthat apply only to screen, and rules that apply only to print. Let’s look at the first rule in the style sheet.p {}font: 12px sans-serif;background: yellow;padding: 10px;495

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!