HTML margin collapsing, still a great old feature

0 views
Skip to first unread message

Mike Austin

unread,
Oct 29, 2025, 1:13:35 PM (5 days ago) Oct 29
to PiLuD
When you're arranging UI you don't want it, but when you have pure text, such as Markdown to HTML, they're a necessity. Two elements next to each other share vertical margin space, the the largest wins (top's bottom margin or bottom's top margin).

It's hard to do headers, lists, and paragraphs without this. At first learning HTML I thought it was a wacky feature, but as I've used it over the years it makes perfect sense when dealing with lots of dynamic content.
Reply all
Reply to author
Forward
0 new messages