[thelist] To print or not to print

Cake cake at brothercake.com
Sat Jan 18 11:42:01 CST 2003


>
> there is a third option...
>


I like to do both - make a php-driven print version page that people can see
and manually print (you could use the onload of that page to trigger
window.print() but imho that's very annoying)  *and* use print-css to define
what happens if they just print the page anyway.

If you do it like

@media screen {

... all your screen CSS

}

@media print {

... all your print CSS

}


then it's easy to develop - you just swap over the media declarations so you
can see it while you test it, then swap them back.   And this snippet does
me well for element print control:

img { display:none; }
img.print { display:inline; }
.noprint { display:none; }

So from that you have:

<img> - doesn't print
<img class="print"> - does print where normally it wouldn't
<element class="noprint"> - doesn't print where normally it would




More information about the thelist mailing list