View Single Post
Old 02-15-2011, 08:03 PM   #1
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,988
Karma: 1285294
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Kindle Fire HDX 8.9 , Kindle for PC
margin top, bottom, additive or not ?

I am a little puzzled as to how these margin top, margin bottom values work, when set in CSS

I have experimented with altering definitons for the calibre css that applies to p tags ( in sigil) & then viewing the results in calibre viewer

i find that non=zero values generate blank lines as per the table below (values in ems)

top = 0, bottom = 0 : no blank lines
top = 1, bottom = 0 : 1 blank line
top = 0, bottom = 1 : 1 blank line

all that makes sense

then comes top= 1, bottom= 1 - I expect to see 2 blank lines but I only see 1 ???

continuing top =n>1, bottom = 0: n blank lines OK

I've not done top=n, bottom=m (n,m>1) to see if I get n+m blanks, or something different. I would have expected n+m blanks but the 1+1 result has thrown me

it is only the 1+1 that is an apparent anomaly

what am I not understanding correctly here please ?

PS I forgot , in this test, to check what happens when both margin top & margin bottom explicit definitions are both removed - I think from past experience that causes p tags to default to just 1 blank line - above or below - not sure which ?

once I get this straight in my mind, I'm thinking of having some global extra css code to hand ( for my default preferences) that lets me easily flip between the various look n feel options currently begin debated & polled elsewhere i.e. indent + no blanks, indent+ blanks, no indent + blanks.

the existing calibre options do some of that already, but not all of it.

AM I right in thinking that can all be done with calibre overrides rather than having to open book & edit CSS ? if so, than I guess this is headint toward suggesting an enhancement to C. look n feel options - where you tick one of 3 ( or more ) predetermined layout styles ( indent + blanks settings) and the book is converted to that presentation for you.

Ultimately it could be a buttom on the e-reader device that enables this. (Kindle already has line spacing, font spacing & words per line user settings )
cybmole is offline   Reply With Quote