Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the default margins in browser print settings?

Tags:

html

css

printing

Does anyone know how many inches are, by default, applied to the top and bottom margins of pages in web print? Specifically for IE and Chrome? Is it half an inch maybe?

I'm asking because I'm writing some css code for adding headers and footers and have adopted a strategy that will use inches to set the heights of the divs on the page.

like image 230
winbacker Avatar asked Aug 19 '14 15:08

winbacker


2 Answers

If you want consistency across browsers, you probably want to set the margins consistently rather than rely on the default values. You can do this with @page CSS:

@page {
    margin-top: 0.75in;
    margin-bottom: 0.75in;
    margin-left: 0.75in;
    margin-right: 0.75in;    
}

Since printers themselves also have minimum margin sizes, and those vary by model and manufacturer, it's generally safest to not use a margin under 0.5inches.

like image 72
William Hertling Avatar answered Oct 13 '22 19:10

William Hertling


  • Internet Explorer 0.75 inch.
  • Chrome 0.4 inch.
  • Firefox 0.5 inch

References

https://support.mozilla.org/en-US/kb/fix-printing-problems-firefox

http://answers.microsoft.com/en-us/ie/forum/ie8-windows_7/what-are-the-default-print-margins-for-ie-678-and/632198b6-d3b7-449a-853a-db8a745bf56e

like image 45
4dgaurav Avatar answered Oct 13 '22 19:10

4dgaurav