View Single Post
Old 02-01-2024, 01:47 PM   #38
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,571
Karma: 129670952
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by nabsltd View Post
Margins only apply to block elements. You can't change the distance between lines of a single block using a margin.
In your example of chapter titles.

HTML
Code:
<h2>Chapter</h2>
<h2 class="ch">One</h2>
CSS
Code:
h2 {
  text-align: center;
  text-indent: 0;
  margin-top: 0.8em;
  margin-bottom: 0;
}
.ch {
  text-align: center;
  text-indent: 0;
  margin-top: 0.2em;
  margin-bottom: 0.8em;
}
Quote:
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.
What's the difference in terms of accessibility?

[quote]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

For a large first letter, a line height of 0 works. No need to have to figure anything out. This works for ePub. But on a Kindle, you cannot use a line height as small as you are saying as it won't work. That's the problem.

Quote:
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.
Padding works if you insist on having blank space for a section break. Margins can get swallowed. There's no visual difference except if the padding falls at the bottom/top of the screen. If it does, then you do see the space.

Quote:
For the firmware I have (fairly recent, as it's a Scribe), both. It might just be a Scribe thing.
Maybe. But for most Kindles a line height small enough to fix a large first letter won't work. It will be ignored.

Quote:
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.
The thing with em is that I have my Libra 2 and you can have your scribe and the indents will be exactly the same at the same font size. With %, we'd have different indents. I've seen many Kindle eBooks using a 7% indent. That's too large. I like a 1.2em indent. But if you do want a slightly larger indent, I think 1.5em would do.

Quote:
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.
Yes, it will be relative. But not the same. The one thing I don't mind (other then for images) is the 40% line I use for section breaks. I don't mind if it's a different length on different screens.
JSWolf is online now   Reply With Quote