Getting More Advanced With Design - The Box Model Cheatsheet - Codecademy
Getting More Advanced With Design - The Box Model Cheatsheet - Codecademy
/
CSS Margin Collapse
CSS margin collapse occurs when the top and bottom
margins of blocks are combined into a single margin /* The vertical margins will collapse to
equal to the largest individual block margin. 30 pixels
Margin collapse only occurs with vertical margins, not instead of adding to 50 pixels. */
for horizontal margins.
.block-one {
margin: 20px;
}
.block-two {
margin: 30px;
}