Make printer friendly web pages easily, avoid banners, images from printing

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



The styles in the print.css will be used only when the document is printed.
These styles will have no effect on the display of the document when viewed
using a monitor, audio browser, or any other non-printing device. So you need
not make seaparate printer friendly pages, but just make a printer friendly
style sheet and link it to web page with media="print".


I will explain it with real example. First we write a stylesheet for screen
display, say screen.css


BODY {color: silver; background: black;}

A:link {color: yellow; background: #333333; text-decoration: none;}

A:visited {color: white; background: #333333; text-decoration: none;}

A:active {color: black; background: white; text-decoration: none;}

H1, H2, H3 {color: #CCCCCC; background: black; padding-bottom: 1px; border-bottom:
1px solid gray;}




Now we have to make a relatively simple stylesheet for printing, say Print.css


BODY {color: black; background: white;}

A:link, A:visited {background: white; color: black; text-decoration: underline;
font-weight: bold;}

H1, H2, H3 {background: white; color: black; padding-bottom: 1px; border-bottom:
1px solid gray;}

DIV.adbanner {display: none;}


Now, to the top of the document, we add the following LINK elements:



This will do the trick. I will suggest to check the browser compatibility b4
implementing this. http://www.codestyle.org/css/media/print-BrowserSummary.shtml


Comments

  1. Hi, I was out blogging and found your aite. It certainly got my attention and interest. I was looking for Monitors
    information and even though this isn't a perfect match I enjoyed your site. Thanks for the read!

    ReplyDelete
  2. Wonderful and informative web site. I used information from that site its great. Car hot magazine rod

    ReplyDelete

Post a Comment

Popular posts from this blog

മലയാളത്തില്‍ മൊത്തം എത്ര അക്ഷരങ്ങള്‍ ഉണ്ട്?

Convert Number To Words in SQL Sever

Crystal reports load report failed: Could not load file or assembly CrystalDecisions.Web, Version=10.2.3600.0