View Single Post
Old 08-18-2025, 08:56 PM   #5
ElMiko
Evangelist
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 493
Karma: 65460
Join Date: Jun 2011
Device: Kindle
@slm - Either I'm misunderstanding the intent of your post, or you are mistaken. Font-size does affect the size of the margin. The 1em of the margin will be in the context of the font-size. So, for example,

the margin in

Code:
p{
font-size: 2em;
margin-top: 1em;
}
will be twice as tall as the margin in

Code:
p{
font-size: 1em;
margin-top: 1em;
}
despite the margin value staying nominally the same.

@JSWolf, DNSB - Gotcha. So, witihin a class, margins and padding will always be derived from the font-size, even if the font size isn't technically declared until the "end" of the style list for that class? I'll see if i can unpack the specificity rules, but they may be over my head.
ElMiko is offline   Reply With Quote