Forum Moderators: not2easy

Message Too Old, No Replies

Print er Friendly Page

         

Cyprus2003

8:48 pm on Feb 28, 2005 (gmt 0)

10+ Year Member



Is CSS used to create print friendly pages. If so, any tutorials or websites? thanks

createErrorMsg

9:52 pm on Feb 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is CSS used to create print friendly pages.

Yes. You write a stylesheet that styles your page the way you want it printed, then link it into the <head> of your document like so...

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

Here are some tips to follow when writing the stylesheet...

  1. Set any elements, like images, navbars, ad blocks, etc that you don't want printed to display:none;
  2. Widen the content display area of your page so text isn't printing in tiny 300px wide blocks.
  3. I usually add a header or footer box (a simple div will do) containing text to the effect of, "This page contains copyrighted material printed from XYZ.com. For more of the same visit us at, www.XYZ.com or email us at me@xyz.com." Set this div to display:none; in the "regular" (media="screen") CSS and display:block; in the print CSS.

Obviously not an exhaustive list of things to do, but a good enough place to start.

cEM

WebGeek

10:56 pm on Feb 28, 2005 (gmt 0)

10+ Year Member



One thing to note is that you still don't have true power over printing. There are no page breaks.