View Single Post
Old 03-31-2017, 08:46 AM   #62
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by JSWolf View Post
What font sizes are <small> , <large>, <x-small>, etc. in em?
Completely platform-dependent. W3C originally recommended a 1.5x factor between each step in CSS1, then changed their mind and decided 1.2x was better in CSS2, and is now rethinking it yet again. That said, their new table translates to:

H6/xx-small: 0.6em
x-small: 0.75em
H5/small: 0.89em (8/9)
H3/large: 1.2em
H2/x-large: 1.5em
H1/xx-large: 2em

Just don't expect to see that etched in stone anywhere. It's a suggestion, not a set of ironclad rules, and implementations will differ.

Quote:
Originally Posted by JSWolf View Post
That's just whoever made the eBook being sloppy.
No, that's called paying attention to detail. If you want exactly 1em (absolute) of space between lines that are not 1em tall, you have to set the appropriate vertical margin to the reciprocal of the active font size. Simply saying "margin-top: 1em" won't do it; that 1em is relative to the element's current size, not an absolute value.

In other words, the H2 element traditionally carries a 1em (relative) top and bottom margin. If it also carries the 1.5em (absolute) font size listed above, then the gap between two consecutive H2 elements will be 1.5em (absolute) - translating to "skip a line between H2 elements."

Thus, if you want an actual 1em (absolute) space between those elements, you have to tinker with the margins by setting them to 0.6667em (relative). That way, 0.6667 x 1.5 = 1, and you get what you're after: a gap the size of a line of standard body text.

Last edited by Rev. Bob; 03-31-2017 at 08:48 AM.
Rev. Bob is offline   Reply With Quote