View Full Version : How to Change Paragraph Indentation

01-30-2013, 05:55 AM
I just downloaded an epub that may have been converted in Calibre. All the rules in the CSS are .calibre, .calibre1, .calibre2, etc. My problem is there is a blank line between paragraphs, and the first line of each paragraph, including in the Table of Contents, is indented. I'm new to editing ebooks. In fact I just started using Kompozer to remove page numbers and unwanted line breaks in some books converted from .pdf. I used to know HTML and CSS, so when I learned about the structure of EPUBs I thought I could do this, but I don't see any CSS that refers to <p> or text-indent. I've tried searching the forum, and Google in general, but I haven't hit on the right combination of keywords. Can someone point me toward a good beginner's page on using CSS for formatting EPUBs? Or maybe just tell me why the paragraphs in this book are indented when in some others (converted from .pdf, but on my computer) are not.

01-30-2013, 06:29 AM
what reader are you seeing this on? i believe that the desktop nook reader software will auto-indent paragraphs unless you've explicitly declared text-indent: 0; in the css. i don't think it's unlikely that other e-readers also exhibit this behaviour.

the spacing between <p> tags probably is the result of padding-top or -bottom in the css, unless there are empty paragraph tags in the html itself (<p>&nbsp;</p>)

01-30-2013, 06:46 AM
Suggest you use Sigil for the epub editing job. It is more stable than Kompozer, made for job and has a lot of features that make things much easier.

With it you can make changes in the css and note the changes in book view.

Make sure that you do not have css at the top of each individual file that is governing this, or that there is in a stylesheet that is controlling everything. Calibre throws in a lot of its own styles which can be overlapping and hard to figure out. Some people just strip them all out in Sigil and take it from there.

It is possible to use Mobipocket Creator to create an html file from the pdf and then add the pages to a blank Sigil document. It will pull in all the associated pictures while it is doing that. The primary shortcoming to this method is that it does not keep the files in order, so it is necessary to drag them around in the book browser in Sigl to get them in order.

01-30-2013, 07:52 AM
Welcome back to HTML/CSS - and, of course, the forum!

W3Schools has a pretty good HTML/CSS/JS tutorial and reference site that will get you back up to speed with the latest changes. Here's a link to their CSS tutorial

One thing to keep in mind - while HTML5 and CSS3 are out and ePub 3 is a standard, there are very few devices that support it fully (yet). Most ePubs are written to the ePub 2 standard which only supports CSS2. Sigil currently only produces valid ePub 2 - with plans to incorporate ePub3 in the (near??) future.

That might allow you to focus your studies!


01-30-2013, 10:43 AM
Before I try to help, I have some questions.

Acharn, is that Calibre converted ePub a legal download? What book is it?

The reason I ask this is that we've had too many people download illegally and then come here for help with these illegal eBooks.

01-31-2013, 01:16 AM
Thanks to all of you for helping. I am using Calibre on my desktop PC to read my books. I finally spotted the offending CSS -- it was in the User Stylesheet of the E-Book Reader. Thanks for the reminder of the tutorial at W3C. I used that when CSS first came out and have gone back to it a few times since, but not for six or seven years. How quickly I forget!