View Full Version : CSS for a Kindle-like text formatting?


december
04-23-2010, 11:16 PM
I apologize if this has already been asked, but does anyone have any suggestions for what CSS coding might produce an e-pub output most similar to the Kindle "default" (i.e., no spacing between paragraphs, and minimal indent - looks to be about three letters' worth of space?)

I'm going a little nuts here trying to replicate it, and am hoping that someone else might have gone this way before me. :) Thanks!

sherman
04-24-2010, 01:40 AM
For no spacing between paragraphs use

margin-top: 0;
margin-bottom: 0;

applied to the tags that contain your paragraphs.

For small indents use something like

text-indent: 1em; //vary size "1em" to suit. can be decimal (eg: "0.9em")

and apply this also to your paragraph containing tags.

Valloric
04-24-2010, 06:44 AM
Try this:


p
{
margin: 0;
padding: 0;
text-indent: 1em;
}Change the value of the text-indent to something else if 1em doesn't suit you. Personally, I always use 1.5em.