Collapsing Margins Playground

The queue at Grandma Marni’s stall: Mrs. Yanti’s and Dodi’s margins are chalked on the ground exactly where the browser put them. Do two margins that meet add…

Why it matters

"Why is my gap only 24 when I set 24 + 16?" and "why is there a gap above my header?" are two faces of margin collapse. Knowing the rule = spacing you can predict, with no hours lost debugging.

The key idea

Touching vertical margins merge, they do not add up

Common mistakes

Try it in this playground