Monday, April 7, 2008

Quick Tip: Margins

Margins in the Kindle are not very easy to format, but there are some tricks that will allow you to add some space between your paragraphs.

The first thing to realize is that the Kindle does not support the regular CSS margin styles. Any of those you use in your document will be completely ignored. The second thing to realize is that, even with the hacks presented here, there is currently no way to give an element a right or bottom margin. Only top and left margins are supported.

To apply a top margin to a paragraph or blockquote, you can add a height="" attribute to the tag. This attribute supports pixels (as a number only: height="30"), percentages (height="10%"), and em-sizes (height="3em"). Here is an example using pixels:

Pixel margins

To apply a left margin to text, you will need to place your text within nested blockquote tags, like this:

<p class="noind">Poetry level 1</p>
<blockquote>Poetry level 2</blockquote>
<blockquote><blockquote>Poetry level 3</blockquote></blockquote>
<blockquote><blockquote><blockquote>Poetry level 4</blockquote></blockquote></blockquote>
<blockquote><blockquote><blockquote><blockquote>Poetry level 5</blockquote></blockquote></blockquote></blockquote>

which looks like this:

Poetry

Notice that there is a limit to the amount of indentation allowed, apparently about 4 levels. Also, notice that I have used a class="noind" in the first paragraph. This calls a p.noind{text-indent:0;} style that removes the default first-line indent applied to paragraphs in the Kindle.

If you have any questions about this or other Kindle formatting issues, or need help with your book, please drop me a line!

Labels:

0 Comments:

Links to this post:

Joshua Tallent's excellent Kindle Formatting service saved me days of frustration. I'm an author with intermediate computer skills, and thought I'd be able to tackle the Kindle techno-challenge myself. Wrong. It was important to me to have my book looking as perfect in the Kindle edition as it does in print, and despite my best efforts I couldn't master the little details—the ones that make a difference. Joshua responded immediately to my Email cry for help, and (after receiving a clean copy of my manuscript in word.doc form) completed the work in an hour and a half. Talent comes in many forms, but if it's technical Kindle talent you're seeking, Joshua Tallent is the man. He has a black belt in Kindle Formatting.

Robin Meloy Goldsby
Author of RHYTHM: A Novel
"Goldsby has a wicked sense of humor and a keen eye for the absurd."
(Publishers Weekly Starred Review)

see all

Blogger makes this NON-Valid XHTML 1.0 Strict
Blogger makes this page break the XHTML strict standards.