The CSS Podcast cover image

68: Why isn't the margin applying?

The CSS Podcast

00:00

The Problem With Vertical and Block Margin Collapsing

Vertical and block margin can collapse. If you have two items stacked on top of each other, right, they're adjacent. Their margins will collapse. The largest of the two will be the one that's used instead of them being combined. And so you can find that block and vertical margins have these collapsing moments. They can be a little tricky and wiggly sometimes.

Play episode from 03:30
Transcript

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app