Independent Articles and Advice
Login | Register
Finance | Life | Recreation | Technology | Travel | Shopping | Odds & Ends
Top Writers | Write For Us


PRINT |  FULL TEXT PAGES:  1 2 3 4 5
Printer-Friendly Web Pages Made Easy 
 
by Scott Nesbitt June 10, 2005

Linking and Testing the Styles

Once you have created your stylesheet, save it. Once you do that, it's time to link it your Web pages. If you combined the screen and printing stylesheets in one CSS file, simply add something like the following to the header of your HTML files:

<link rel="stylesheet" href="myStyle.css" type="text/css" />

If, on the other hand, you have your print styles in a separate CSS file, add something like the following to the header of your HTML file:

<link rel="stylesheet" href="myPrint.css" type="text/css" media="print">

The media="print" attribute tells the browser to apply the stylesheet myPrint.css whenever a Web page is sent to a printer. Remember also to link your screen CSS file to the Web page in the same way. For the screen stylesheet, however, specify media="screen" instead of media="print".

There are two ways that you can test your print styles. The most obvious one is to actually print a page. But doing this wastes paper and printer ink. A better way is to use your Web browser's print preview feature. In most browsers, regardless of the operating system on which they're used, Print Preview is found under the File menu.

You might have to fiddle with your stylesheet to get it looking just right for print. If possible test it with as many CSS-capable browsers as possible.

Conclusion

Creating printer-friendly versions of your Web pages doesn't require a lot of fiddling on the server side of things. Using CSS, you can easily and quickly retrofit your existing Web pages. You'll no longer need a "Print this page" or "Printer-Friendly Version" button or link on your pages. Visitors to your Web site will just have to click the Print icon in their browsers and they'll get a nicely-formatted hard copy of your Web content.

PREV PAGE 1 2 3 4 5 NEXT PAGE

 




Home  |  Write For Us  |  FAQ  |  Copyright Policy  |  Disclaimer  |  Link to Us  |  About  |  Contact

© 2005 GoogoBits.com. All Rights Reserved.