Does anyone know how to use CSS to resize the webpage for printing on a specific type of paper
The following code below does not work.
Can anyone help me by showing me a small example of the code? i am new in CSS.
Thank you
<html>
<head>
<style type="css">
@page {
size: A4 landscape;
}
</style>
<title>Request Information</title>Use a print style sheet.
Link to it like this :
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"print.css" media="print" />
You can do great things with a print style sheet. For example, if you have a menu that you don't want to appear on your printed page, you can set its diplay to display:none.
This might give you more room for whatever it is you really want printed out.
Unfortunately, I don't know how to get it to automatically print 'landscape' - I tried the code you have there - nothing. I don't know why.This might be of interest to you: CSS Print Profile (<!-- m --><a class="postlink" href="http://www.w3.org/TR/2004/CR-css-print-20040225/">http://www.w3.org/TR/2004/CR-css-print-20040225/</a><!-- m -->).I read through the CSS Print Profile link, and I'm getting that it is not currently possible to set the page to print in landscape. This is what I'm currently trying to do (or work around, I guess). I design my site for 800x600, but when you print tables that wide, it's cut off on the side from the printer. Not good.
I'm assuming CSS can control the overall width of my tables?? If so, then I can make them one width in my print style sheet and the other in my screen/media style sheet.
Perhaps a similar idea will work for you... in your print style sheet, have a container table/div resize appropriately for the A4 Landscape paper.
I'll try it on mine anyway!
Good luck,
Deb
The following code below does not work.
Can anyone help me by showing me a small example of the code? i am new in CSS.
Thank you
<html>
<head>
<style type="css">
@page {
size: A4 landscape;
}
</style>
<title>Request Information</title>Use a print style sheet.
Link to it like this :
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"print.css" media="print" />
You can do great things with a print style sheet. For example, if you have a menu that you don't want to appear on your printed page, you can set its diplay to display:none.
This might give you more room for whatever it is you really want printed out.
Unfortunately, I don't know how to get it to automatically print 'landscape' - I tried the code you have there - nothing. I don't know why.This might be of interest to you: CSS Print Profile (<!-- m --><a class="postlink" href="http://www.w3.org/TR/2004/CR-css-print-20040225/">http://www.w3.org/TR/2004/CR-css-print-20040225/</a><!-- m -->).I read through the CSS Print Profile link, and I'm getting that it is not currently possible to set the page to print in landscape. This is what I'm currently trying to do (or work around, I guess). I design my site for 800x600, but when you print tables that wide, it's cut off on the side from the printer. Not good.
I'm assuming CSS can control the overall width of my tables?? If so, then I can make them one width in my print style sheet and the other in my screen/media style sheet.
Perhaps a similar idea will work for you... in your print style sheet, have a container table/div resize appropriately for the A4 Landscape paper.
I'll try it on mine anyway!
Good luck,
Deb