The Rules of Margin Collapse
Josh Comeau covers the concept of margin collapsing:
…This idea might sound simple, but if you’ve been writing CSS for a while, you’ve almost certainly been surprised when margins either don’t collapse, or they collapse in weird and unexpected ways.