margin
Transparent space outside an element's border that pushes neighbouring elements away.
In more detail
Vertical margins between blocks can collapse into one. In a flex container, margin-top: auto soaks up all spare space, a classic way to push a button to the bottom of a card.
Related terms
- margin collapsing — The CSS rule that when two vertical margins of blocks touch, they merge into one margin equal to the larger of the two instead of adding up.
- CSS box model — The rule that every element is drawn as a rectangle made of four layers: content, then padding, then border, then margin.
- padding — The space inside an element between its content and its border, filled with the element's background.
Taught in
- Modern Box Model, Box Sizing, Display Types And Flow Layout — Frontend Architecture & Web Platform
- CSS Subgrid: Inheriting Track Sizing Across Nested Layouts — Frontend Architecture & Web Platform