FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Printer friendly webpages

 


zorindart
I'm trying to make one of my sites "printer friendly" so I create a css file only for printing.
<link rel="stylesheet" type="text/css" href="../print.css" media="print" />
In this css I changed some things and I added the following code:

H1, H2, H3, H4, H5, H6 { page-break-after: avoid;
page-break-inside: avoid }
p {
widows : 3;
orphans : 3;
text-align: justify}

to avoid titles printed in other page than its following texts, and to avoid "widows" and "orphan" lines...

But it doen't work. I tried it in Internet Explorer, Firefox, Opera and Konkeror, but none of these seem to accept these css rules.

Any suggestion?
darkness
You can try this:
Make your normaly page. Then make a link with an image "you can take the best a printer image" you can choose thisone but make it smaller and make the link to a white page with only text and set this code to your 'print page'
Code:

<script language="Javascript1.2">

function printpage() {
window.print(); 
}

</script>


The link of your print link to print your page
Code:
<a href="printpage()">


Hopes this work
drpiga
This is the really best CSS file for printing friendly documents.Give a try:

Quote:


body {
background: white;
font-size: 12pt;
}
#menu {
display: none;
}
#wrapper, #content {
width: auto;
margin: 0 5%;
padding: 0;
border: 0;
float: none !important;
color: black;
background: transparent none;
}
div#content {
margin-left: 10%;
padding-top: 1em;
border-top: 1px solid #930;
}
div#mast {
margin-bottom: -8px;
}
div#mast img {
vertical-align: bottom;
}
a:link, a:visited {
color: #520;
background: transparent;
font-weight: bold;
text-decoration: underline;
}
#content a:link:after, #content a:visited:after {
content: " (" attr(href) ") ";
font-size: 90%;
}
#content a[href^="/"]:after {
content: " (http://www.yoursite.com" attr(href) ") ";
}
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.