View Single Post
Old 09-15-2010, 10:47 PM   #7
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,188
Karma: 727236
Join Date: Sep 2009
Device: PRS-505
Code:
@page {
  margin-top: 9pt;
  margin-bottom: 1pt
}

body {
  font-size: 100%; 
  line-height: 1.25em; /* just a bit more leading than the standard of 1.2 because I read at small sizes. I sometimes bump the font up to 105% too so that the smallest size is easier on my presbyopic eyes */
  margin: 0 12pt;
}

p.flushbrk {  /* the class for the initial paragraph of a section */
  margin-top: 1.25em;
  margin-bottom: 0;
  text-indent: 0
}

p. indent { /* the class for standard indented paragraphs */
  margin: 0;
  text-indent: 1em
}

p. centerbrk { /* for scene-break markers such as asterisks */
  margin: 1.25em 0;
  text-align: center
}

div.extract { /* a div that wraps around paragraphs that are further indented (e.g. verse, letters, etc) */
  margin: 0.625em 2em;
  text-align: left
}
/* often there will be different variations of extract, some with both left and right indents, some with just a left indent, some using a different font, etc */
All formatting is done in the css - I strip out line-spacing garbage (trailing <br/>s and empty p or div tags) using regexes.

All vertical margins are related to the line-height (either a simple fraction or integral multiple) and margins using fractions of the line-height are organised so that the top and bottom add up to a multiple, eg for a subhead I might use
Code:
p.subhead {
  margin-top: 1.875em;
  margin-bottom: 0.625em;
  font-style: italic
}
so that the total spacing retains the rhythm of the surrounding body text but the subhead is shifted towards the text to which it relates.
charleski is offline   Reply With Quote