There are circumstances under which elements' vertical margins will collapse. Sometimes the author doesn't want this to happen, and I understand that the only way to "un-collapse" margins is to:
- Set a
border
sized >=1px
- Set a
padding
sized >=1px
These workarounds make sense to me, but they are just that: workarounds, and they have drawbacks. I'm surprised that there's not some kind of css3 property like margin-collapse: none;
, similar to border-collapse
.
Is it really true that setting a border/padding is the only way to uncollapse margins?