Usergent - Implementing Printer Friendly

G

Guest

Can any one help me out?
I am looking out to implement printer friendly version of a web page.
I do not want the header and footer show up in the print and I do not want
to use frames (it is a client decision). I want to avoid writing the code
again to make the printer friendly.

Is there any way which would allow me to make the developer friendly page
without lot of additional duplicate work.

Thanks in advance.
Dinoo
 
N

neilmcguigan

use cascading style sheets. have a @media for print, and another for
screen

the one for print can hide the headers/footers

see

http://www.w3.org/TR/REC-CSS2/media.html

example:

<style type="text/css">

@media screen
{
.MyHeaderClass { display:block; }
}

@media print
{
.MyHeaderClass { display:none; }
}

@media screen, print
{
.SomeOtherClass { font-family:Arial }
}

</style>

when the user prints the page, the MyHeaderClass won't show up
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top