View Full Version : about Printing webpages
Disturby
09-13-2001, 02:28 PM
Is there a way that you can assign in your HTML witch part of the page should be printed when a visitor decides to print your page?
If that would be possible the menu system of the page wouldn't be printed with the content...
Dr. Web
09-13-2001, 02:48 PM
if you've built it into frames it is possible. But generally it prints what is visible on the screen.
You could build a custom function to hide elements of the page just before printing, and then show them after the page is printed.
Jon Hanlon
09-13-2001, 07:56 PM
For IE5 and above you can use @media in styles, won't work for IE4, nor (naturally) Netscape.
<style>
.hiddenText,
.hiddenScreen { position: relative;
visibility: hidden;
display: none }
.hiddenPrint { visibility: visible;
display: inline }
/* You can't bundle these into one @ because IE4 goes mental */
@media print {
.hiddenScreen { page-break-before: always;
position: relative;
visibility: visible;
display: inline }
}
@media print {
.hiddenPrint { position: relative;
visibility: hidden;
display: none }
}
</style>
<span class="hiddenPrint"><h1>I won't Print</h1></span>
<span class="hiddenScreen">I won't appear on the screen, only on a Printout</span>
If the content is dramatically different, you can maintain a separate print-version of the page, and use:
<head>
<link rel="alternate" media="print" href="printedversion.html" >
This will work in most browsers.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.