Quote:
Originally Posted by akratic
The offical FAQ mentions that this thread is the right place to contribute to the official FAQ.
The answer to the following FAQ question: How do I add margins to the text? could be significantly improved.
In particular, body { margin-left: 2em; margin-right: 2em; } is recommended, which will only add left and right margins. Extending this example to body { margin: 2em } doesn't work well either, adding top and bottom margins only to the entire book.
After a fair bit of searching on this forum, I discovered that a better approach for margins is: @page { margin: 2em; } which will add margins to every page of the book.
|
to further expand on this point, i don't recommend using ems as the unit of measurement for margins, since that is a proportional unit (it is the width of the letter "m" in whatever font size you are using. if the font size itself is defined in ems, 1em is around 16pt). this means that if you enlarge the text, the margin will also be enlarged proportionally. it's better therefore either to use percentage (which is proportional as well, but to the size of the display) for example :
body {margin : 15%;}
or
@page {margin : 15%;}
or use pixels (this is a fixed unit and will not vary proportionally), for instance
body {margin : 20px;}
or
@page {margin : 20px;}