View Single Post
Old 01-04-2018, 08:59 PM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,625
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Adjusting "space" paragraph width

Hi

I format ebooks using styles. I use a main textbody paragraph style. Nothing unusual.

Sometimes, it's required to mark a breathing space between text paragraphs.

The non-recommended (dirty?) way to do it is to add an empty paragraph. Easy, you just click "Enter" in a text-processor and get a <p> </p> in your html (or many if you click several times).

You also can try to do it in a "cleaner" way
- either using a slightly modified textbody style, incorporating a bigger margin-bottom value of some pixels. You need to make use of two styles (or of two different classes).
- or by creating a dedicated "space" paragraph. To avoid it to be empty, you can insert a nobreak space. You give it a class name (say "BlancUn"), provide this css class with some margin and padding values.

Either way, when you display it, you may realize using the Inspector of the Calibre editor, that you do not get the exact vertical margin width you were aiming for because a 1em -webkit-margin-before and a 1em -webkit-margin-after seems to be systematically added by the so called "user agent stylesheet" (see screenshot). This spoils the space display if you wish to use only a small value.

I'd like to know if this user agent values are only a Calibre editor peculiarity or if it will be met elsewhere with common ebook-readers. Maybe the optimal way to deal with this would be to add some null webkit margin values in the css?
Attached Thumbnails
Click image for larger version

Name:	webkit.png
Views:	256
Size:	52.2 KB
ID:	161258  

Last edited by roger64; 01-04-2018 at 09:45 PM. Reason: optimal and -webkit
roger64 is offline   Reply With Quote