Collapsing margin is a CSS layout behavior in which adjoining vertical margins combine instead of adding together. It can explain why the gap between elements is smaller than their declared margins suggest; horizontal margins do not collapse. section 2.2
A spacing question
An element has a 50px bottom margin, and its next sibling has a 30px top margin. Why is the gap 50px, not 80px? Their adjacent vertical margins collapse into one effective margin. section 2.2
Check for collapse between adjacent siblings, between a parent and child with no separating padding, border, or content, and in empty blocks. To prevent parent–child collapse, add padding or a border, or use non-visible overflow. Margins do not collapse in flex or grid containers. When debugging, identify which margins meet before changing their values. section 2.2

