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).
Written by Jeremy Worboys
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#