View Single Post
Old 02-15-2011, 08:07 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by cybmole View Post
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 )
No 0 values need UNITS. I use EM, which scales with Zoom (at least, within EPUB)

They are adjacent ('boxes', in the box model): Bottom: 1em (para#1), top: 1em (para#2) get added for a total of 2em between paras 1 and 2.
You play 'stack the blocks'
Link to w3schools box model
http://www.w3schools.com/css/css_boxmodel.asp
theducks is offline   Reply With Quote