Margin
Space around the outside of a page or element.
See it on the 3D treeGoing deeper
On a printed page, margins frame the text block and leave room for thumbs, page numbers and trimming. In CSS, margin is the transparent space outside an element's border, separating it from neighbours. Adjacent vertical margins between blocks can collapse into one in normal flow.
Why it matters
Margins give content breathing room and control how separate or connected neighbouring blocks appear.
In practice
You add more space above a section heading than below it, so it visibly belongs to the text that follows.
Common mistake
Using margin when you need space inside a coloured box, so the background never extends around the content.
Connected terms
- PaddingPadding is space inside the border; margin is space outside it.
- White SpaceMargins are one of the main sources of white space.
- Box ModelMargin is the outermost layer of the CSS box model.
- Safe AreaPrint margins and safe areas both keep content away from risky edges.