View Single Post
Old 01-20-2010, 03:01 PM   #14
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
Quote:
Originally Posted by akratic View Post
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;}

Last edited by zelda_pinwheel; 01-20-2010 at 03:06 PM.
zelda_pinwheel is offline