Prev | Current Page 491 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

However, if you??™re using CSS layouts, it??™s possible to create a style sheet specifically for
print, which you can use to dictate exactly which elements on the page you want to print,
which you want to omit, and how you want to style those that can be printed.
As mentioned earlier in the book, a print style sheet is attached to web pages using the
following HTML:
?‚ href="print-style-sheet.css" />
The media attribute value of print restricts the CSS solely to print, and within the print
style sheet, you define styles specifically for print, such as different fonts and margins. In
the example in the download files, I??™ve used a version of the business website, which you
can access via the sme-website-print folder in the chapter 10 folder. The print style
sheet is sme-print.css, and if you compare it to the main style sheet, you??™ll see that it??™s
much simpler and massively honed down.
The defaults section houses a single body rule, defining padding (to take into account varying
printer margins, 5% is a good horizontal padding to use), the background color (white
is really the only choice you should use, and it??™s usually the default, but setting it explicitly
ensures this is the case), the text color (black is best for contrast when printing), and the
font. There??™s absolutely no point in trying to ape your onscreen design and typography in
print??”instead, use values that enhance the printed version.


Pages:
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503