In [[css]], adjacent margins can sometimes overlap due to something called 'margin collapse'. The rules around it are a little confusing, and often means developers opt into using something more consistent such as padding.
However it is a feature that can be tamed, and knowing how to use it sometimes comes in handy. For example, Capsize applies negative margins in combination with display: table
to pseudo elements to avoid margin collapse.
Some hard and fast rules:
https://www.joshwcomeau.com/css/rules-of-margin-collapse/ https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing