Prev | Current Page 495 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

Note, however, that you should be
mindful to not hide weighty images in this manner, otherwise you??™ll compromise download
speeds for anyone using your website in a browser, only for making things slightly better
for those printing the site. A small, optimized GIF should be sufficient.
If there??™s other content you want to hide in this manner, you can also create a generic
printOnly class to apply to elements you want hidden in the browser, but visible in print.
The following CSS rule applied to your screen style sheet would be sufficient for doing
this:
.printOnly {
display: none;
}
The reason for not using this generic method with the logo is because at the time of writing,
Opera appears to only print images cached from the normal page view??”in other
words, if the image isn??™t displayed in the standard browser window, Opera won??™t print it.
Therefore, if using the generic printOnly class, be aware that any images hidden won??™t
print in Opera, but text will.
An example of how the print style sheet looks is shown in the following screenshot.
If you??™ve used Internet Explorer expressions for fixing layout issues with IE 6 and
lower (see Chapter 9), these may ???leak??? into the print version, regardless of
whether you??™ve attached the style sheet by using a media attribute of screen. In
such cases, use a conditional comment to attach an IE-specific print CSS that
overrides the expression value or values.
PUTTING EVERYTHING TOGETHER
395
10
Note that you can take things further in terms of layout, but it??™s best to keep it simple.


Pages:
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507