PDA

View Full Version : CSS: Hiding Background at Print


A1ien51
09-20-2002, 05:07 PM
what is the css code for hiding the background from the browser at print. I have it somewheres on this computer, and I can not find it! been searching for awhile, and I am giving up!

A1ien51

MCookie
09-20-2002, 06:15 PM
Maybe the answer is here;
http://www.codingforums.com/showthread.php?threadid=6010&highlight=print.css

chanota
09-20-2002, 06:48 PM
http://www.willscgiscripts.netfirms.com/gprint2002.html

this is a perl script. donno if its what your looking for or not.


http://www.scriptsearch.com/cgi-bin/search.cgi?searchfrom=top&q=print+text+only&submit=Search

goodluck
Renee

COBOLdinosaur
09-22-2002, 05:02 PM
For IE5+ you can do it the easy way:

<BODY style="background-image:url(yourimage.jpg)"
onBeforePrint="document.body.style.backgroundImage=''"
onAfterPrint="document.body.style.backgroundImage='yourimage.jpg'">

Roy Sinclair
09-23-2002, 08:04 PM
Originally posted by A1ien51
what is the css code for hiding the background from the browser at print. I have it somewheres on this computer, and I can not find it! been searching for awhile, and I am giving up!

A1ien51

While those other ideas are interesting, the CSS way of doing it is covered here (http://www.w3.org/TR/CSS2/media.html) . Basically it's done by specifying different style sheets for different media.