View Single Post
Old 11-29-2021, 11:18 AM   #19
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 318
Karma: 3200000
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
Quote:
Originally Posted by Bigo2 View Post
Thank you everybody for helping me with a fancier numbered list.
Regarding the way I tried to do it - using a negative top margin for sending the text up to align it with the number - I would like to know WHY it cannot be done?
I tried using the same font for the number line as well as the text line and the same line-height and the font-size, and I set everything in px. It did not help. Everything is ususlly OK in Sigil and aslo in Calibre Ebook viewer, but not in Kindle...
Why would it shift out of alignment?
How come there is no solution?
There were several problems in your original attempt. Using a fixed value like pixels does not work, because line-height can vary in ways you cannot control. It assumes the gap you’re filling is exactly 18px tall, but that won’t always be the case.

Also, <dd> is not correct semantics (course, nor is <p>). That <dd> belongs in a <dl>, paired with a <dt>. From a visual perspective, it may inherit some other styling for that element that you didn’t intend. Overall I would say it was kind of a very cumbersome way to try to build something that (imo) hasn’t got much benefit. And generally this sort of reshuffling of block-level elements via negative margin values and the like are risky and unreliable in general.

Last edited by phillipgessert; 11-29-2021 at 12:43 PM.
phillipgessert is offline   Reply With Quote