Quote:
Originally Posted by JSWolf
To specify margins, one way to do it is by using @page in the CSS as the first line like the following code. that way, you don't have to go digging into the CSS to find all the places that specify the margins.
Code:
@page { margin-bottom: 1em;margin-left: 1em;margin-right: 1em;margin-top: 1em;}
|
just a note, as i just mentioned in the sigil forum, it's not a good idea to use ems as a unit of measurement for margins. ems are a proportional unit, equal to the width of the letter "m" in the font size in use (when ems are used to define font size, 1em is equal to about 16pt). this means that if you increase the font size, the margins will also be increased, leaving less room for text. instead, you should use either percentage (also proportional, but based on the size of the display) or pixels. so the code could look like this :
@page {margin : 15%;}
or
@page {margin : 20px;}
defining a global "margin" as i did above sets the same margin on all 4 sides. you can refine this with a different margin for top/bottom vs. sides by specifying two measures :
@page {margin : 20px 10%;}
= 20px for top and bottom, 10% for right and left.
or specify a different margin for each side like jon did in his example.