Introduction
There were always problem in printing a web page. The problem is what users expect. The user wants only a specific part but the print gives the whole page something like a screenshot. To solve this, we can use the media="print" attribute of the <link /> tag. The CSS media type “print” allows authors to specify a stylesheet that is only used when printing. This can be very useful and allows for neatly styled printouts that hide non-essential parts of the page like adds, images, unwanted designs etc. To achive this, create a separate stylesheet say, print.css, and put your styles in the file. Apply the styles to the fields, which you want to customise while printing and then add the following in your page's head section.
<link rel="Stylesheet" href="../Style/print.css" media="print" type="text/css" />
<img src="<your image path>" class = "<some other classes> hideSection" />
So when the time of print the page will not show this <img /> tag. Give it a try!!
Thanks Suresh
Richard Mueller edited Revision 3. Comment: Spelling in title, title casing, added language tag
Carsten Siemens edited Revision 2. Comment: typo fixed
Richard Mueller edited Revision 4. Comment: Changed rgb values to color names in HTML to restore colors