Explain it in 60 seconds
Margin collapsing
Frontend Engineering · HTML and CSS · Beginner
What is margin collapsing in CSS?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Vertical margins between blocks combine into the larger one.
- Parent and first/last child margins can collapse.
- Doesn't happen in flex/grid or with padding/border.
- Horizontal margins never collapse.
- Source of spacing surprises.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.