3 ms·
It means minimum distance. A key feature is margin is it can collapse. So if paragraphs have 1rem between them, and headings have 2rem above and 1rem below, you
by coffeefirst 7y ago
It means minimum distance. A key feature is margin is it can collapse. So if paragraphs have 1rem between them, and headings have 2rem above and 1rem below, you won’t wind up with 3rem between the paragraph and the following heading. Padding adds together, and space mechanisms seem like overkill when css can already do the thing in a straightforward way.
What’s befuddling to me about these threads is that they keep trying to make an absolute case. It’s true, I use margin less now that I have grid gap, but there’s still a place for it.
- lolc 7y agoMost people don't understand collapsing margins. I know I don't. I always have to read up when I deal with margins. And protip: Whenever you have a CSS problem, think: "Oh, I'll just use negative margins!"