Loading...
.card {
background: #eee;
}
.card h2 {
margin-top: 24px;
}.card {
background: #eee;
display: flow-root;
}
.card h2 {
margin-top: 24px;
}display: flow-root stops the child margin from escaping the parent, so the space appears inside the card.
margin-top to the first child and seeing the whole parent move down instead.No. Margins of flex items and grid items never collapse with each other or with their container.
No. In horizontal writing modes only vertical (block-direction) margins collapse.
The larger margin wins. If one is negative, the result is the largest positive margin plus the most negative one.