I use the following css to set the document’s margins for when it is printed.
[code]
@media print {
body {
margin-right:5cm;
margin-top:5cm;
margin-bottom:5cm;
margin-left:5cm;
}
}
It works fine if the body content does not have any element with fixed width. Like this:
[code]
<div> … some big text …</div>
But if an element has any width set, all margins work EXCEPT the right one!
[code]
<div style=”width: 400px;”> … some big text …</div>
I don’t see any reason for a fixed width to affect the print margins, because if you use the browser to change the margins it will respect your changes, but the same doesn’t happen here with the css… why?? Is there any work around?
This happens in both FF and IE.