Good ol’ Margin Collapsing

Here’s a one-sentence blog post about margin collapsing: When two block elements are stacked on top of one another, the vertical space between them is the larger between the one on top’s margin-bottom and the one on the bottom’s margin-top.
It’s a bit weird and ascii-shruggy. Couple caveats with them, as you might expect.

I find it fascinating how it makes for the perfect sort of mini blog post when people have an ah-ha moment about it. MDN even …
The post Good ol’ Margin Collapsing appeared first on CSS-Tricks.

Link: https://css-tricks.com/good-ol-margin-collapsing/