Last Updated: February 25, 2016
·
567
· jeremyworboys

Collapsing Margins

Adjacent top and bottom margins of block elements will collapse to the largest specified distance.

Example:

<div>margin-bottom: 10px</div>
<div>margin-top: 15px</div>

Consider the margins in the example applied to the elements with CSS.

Will render with a 15px space in between.

It is important to remember that this only applies to two block elements (not inline or inline-block).