I created a simple print CSS which generates an A4 page.
<!doctype html>
<html>
<head>
<style media="print">
* {margin:0;padding:0}
@page {size: 297mm 210mm; margin:0mm;}
html, body {width: 297mm; height: 210mm}
html {background-color:red}
body {background-color:green}
</style>
</head>
<body>
<p>TEST</p>
</body>
</html>
With Firefox 38.0.1, in the Print Preview window, the body (green colored) has an extra height which triggers a second page
If I print the file, 2 pages are printed, so it is not a problem related only to the print preview.
I already removed all the margins from the Page Setup section and all the extra elements which Firefox adds (like title, url, date, ...)
The same page on Chrome 43.0.2357.81 does not have any problem
How can i solve that?
Firefox can show blank previews and print blank pages if the configuration is corrupted. In some instances, Firefox prints only the second page blank, and it can also occur due to incorrect page settings. Fortunately, you can fix this issue with a simple browser reset.
Click on the Office button and then on Word Options and then on Display and uncheck the box for "Print document properties" under the Printing options section of the dialog. Was this reply helpful?
1. To access the print settings, please see the upper, right-hand corner of the Firefox window, and select the Open Menu icon (highlighted in blue below). 2. Select the Print icon.
Use this, it will work straight forward :)
<!doctype html>
<html>
<head>
<style>
@media print {
* {margin:0;padding:0}
@page {size: A4 landscape; margin:0mm;}
html, body {height: 100%;}
html {background-color:red}
body {background-color:green}
}
</style>
</head>
<body>
<p>TEST</p>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With