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:

If I am logged on, you can also call me!

If you would like to chat, please fill out your name in place of the guest number above.

I am pleased to say, Joshua Tallent, at kindleformatting.com was the perfect solution for two questions I was having trouble finding answers for; how can I get my three books formatted for the Amazon Kindle program, and who can guide me through the process.

Joshua was absolutely wonderful to work with—and he wasn't afraid to actually talk with me on the telephone. With his easy-to-understand guidance, this very scary process turned out to be a snap—plus, the costs were much less than I had imagined.

Kent D. Walsh

see all

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