[geeks] html (css) trick for (not) printing?

Nadine Miller velociraptor at gmail.com
Fri May 30 19:45:39 CDT 2008


Joost van de Griek wrote:
> On 30/05/2008, Francois Dion <francois.dion at gmail.com> wrote:
> 
>> Is there a way to have an element on a web page visible, but when you
>> print the page it wont be on the printout? I have a workaround, but it
>> has always seemed a bad way of doing this. I was wondering if maybe
>> there's a css property I could set that would do the trick, but
>> haven't found any.
> 
> Yes. You can assign media types (print, screen) to style sheets, so
> specify the visibility for the element differently in each style
> sheet.
> 
> Of course, plenty of browser will foul this up, but that would
> theoretically be the correct way to go about it.

You could also set up a separate link with a different (or have portions 
different) style sheet all together for printing.  You see the "printer" 
graphic button on a lot of web pages for this purpose.

=Nadine=



More information about the geeks mailing list