View Single Post
Old 02-01-2024, 12:47 PM   #36
nabsltd
Evangelist
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 419
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
Quote:
Originally Posted by JSWolf View Post
Use a margin instead of a line height.
Margins only apply to block elements. You can't change the distance between lines of a single block using a margin.

And, accessibility says that you should not split what is logically a single block into multiple blocks. So, sometimes you have to adjust line-height for that block.

Quote:
Maybe it works on your Scribe, but I know for sure that older Kindles would not work with a line height of 1.
That's because using line-height: 1; means "use the default line height for this inline element when computing the line height of the entire line". The correct line height to use is (1 / font-size). So, if the initial cap is 3em, then use a line-height of 0.33. For inline elements that use the same or smaller font size as the base text (like a superscript), line-height: 1; will work.

Quote:
That's because the section break space was a margin and not padding. Padding works as the space does not disappear.
Padding has a different meaning in CSS than a margin. Margins separate two block elements, while padding separates the content of a block from its border. Just like you should not use <p>&nbsp;</p> to create a blank space between two paragraphs, you also should not use padding to change the amount of space between two blocks.

Quote:
Does this appy to KF8 or just KFX?
For the firmware I have (fairly recent, as it's a Scribe), both. It might just be a Scribe thing.

Quote:
I'm not meaning font size. I've seen many cases where the margin uses % and that changes based on the screen. So using em will be consistent regardless of the screen.
No, em for margin will vary based on the font size the user chooses in the UI for the reader. This will quickly get out of hand for larger font sizes, and leave a much less noticeable margin for small font sizes. It really gets bad with headings, even with a font size as small as 2em. If the margin is 4em (not unusual), and the chosen base font size is 2x the default, you end up with a margin that is 8x the height of a normal line., with the heading taking up 4x a normal line. That's 12 normal lines, which is half the screen on a 6" device. Using a margin of 15% would mean the start of the text would be the same as using em with a normal font size, but only 31% down the screen with the doubled font size.

Percent will always leave the same relative space on the screen, so that 10% will always be 1/10th of the height/width of the screen. This is how physical books have always done it...margins on paperbacks are smaller in absolute width than on a hardback, but are almost exactly the same percentage of the page.
nabsltd is offline   Reply With Quote