The margin-bottom property sets the margin area on the bottom of an element. A positive value moves neighbors farther away; a negative value pulls them closer.
It is part of the box model (outside the border), is not inherited, and has no effect on non-replaced inline elements such as <span>. Prefer margin-block-end when you want spacing that follows writing mode.
Baseline · Widely available.
Not deprecated. Core length, percentage, and auto values work across modern browsers.
Syntax
CSS Syntax
syntax.css
margin-bottom:<length> | <percentage> | auto | inherit;
Example: margin-bottom: 1.5rem;. Values may be positive, zero, or negative.
Negative length. The bottom margin becomes less than zero.
Next box moves up. Content can overlap if the value is large enough.
Use sparingly. Prefer padding, gap, or positive margins for everyday layout.
Check stacking and click targets when boxes overlap.
Edge Cases & Pitfalls
If the gap looks wrong or missing, check these first.
collapse
Vertical margins can collapse
A block’s margin-bottom and the next block’s margin-top may combine into one gap — often the larger value, not the sum.
inline
No effect on non-replaced inline
MDN: margin-bottom does not affect elements like <span>. Use a block, inline-block, or flex/grid item instead.
percent
% is based on width
Even for bottom margin, percentages resolve against the containing block’s inline size (width in horizontal writing modes).
vs
margin-bottom vs padding-bottom
Use padding-bottom for inner space (backgrounds extend into padding). Use margin for space between separate boxes.
logical
Physical bottom vs block-end
For multilingual or vertical layouts, prefer margin-block-end so spacing follows writing mode.
Compatibility
Browser Support
margin-bottom is a browser CSS property for the box model. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
margin-bottom
Length, percentage, and auto values work in all modern browsers and older engines.
99%Browser support
Google ChromeAll modern versions
Full support
Mozilla FirefoxAll modern versions
Full support
Apple SafariAll modern versions
Full support
Microsoft EdgeAll modern versions
Full support
OperaAll modern versions
Full support
Samsung InternetSupported
Full support
Internet ExplorerSupported
Full support
margin-bottomWidely supported
Bottom line: Safe for everyday vertical spacing. Remember collapse and the %/width rule. It is not a runtime API.
Remember
Key Takeaways
Role: outer space below an element’s border.
Initial:0. Not inherited.
Percentages use containing-block width.
Collapse can merge adjacent vertical margins.
One line:margin-bottom pushes space under a box — outside the border, before the next element.
Frequently Asked Questions
It sets the outer space below an element, outside its border. A positive value pushes following content down; a negative value pulls neighbors closer.
The initial value is 0. There is no bottom margin until you set one.
margin-bottom is outside the border, between elements. padding-bottom is inside the border, between the border and the content.
margin-bottom always targets the physical bottom edge. margin-block-end follows writing mode, so it maps to the block-end side in vertical or RTL layouts.
Yes. Adjacent vertical margins between block boxes can collapse into one. The used gap is often the larger of the two margins.
It is Baseline Widely available. It is a browser CSS box-model property, not a Node.js runtime feature.