View Single Post
Old 09-20-2024, 02:58 PM   #8
foosion
Evangelist
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 474
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by Jellby View Post
Margins are combined/collapsed, padding is not. A div with bottom-margin:2em followed by a div with top-margin:1em will have 2em spacing between their contents (the largest margin survives). The same with padding will result in 3em spacing (they're just added). If there are borders, margin goes outside, padding goes inside.
That makes sense and could account for the difference if there's a div margin.

In my test case, there's no explicit div. If what I read is correct, the default margin, padding and border for div is 0.

I tried surrounding a chapter with <div> ... </div> (just inside body) and defined div as margin; 0. It didn't make any difference (as it shouldn't, based on the default).
foosion is offline   Reply With Quote