In a horizontal writing mode (the usual default), that maps to top and bottom — like margin-top / margin-bottom. With a vertical writing-mode, it can map to the physical left/right sides instead. It is not inherited. Each side starts at 0.
Baseline · Widely available.
Not deprecated. Cross-browser since about April 2021. Prefer it over physical top/bottom when writing mode may change.
Logical tip.
Pair with margin-inline for the other axis. Together they replace the classic four physical margins in writing-mode-aware layouts.
Change the flow.writing-mode: vertical-rl makes lines run vertically.
Keep logical margin.margin-block still means start/end of the block axis.
Physical sides change. The same rule may now affect left/right instead of top/bottom.
Why it matters. One rule stays correct when orientation changes.
Edge Cases & Pitfalls
Logical names are easy to mix up with physical top/bottom.
mapping
Not always top and bottom
In vertical writing modes, block-start/end can map to physical left/right. Check writing-mode before debugging.
collapse
Block margins can still collapse
In normal flow, adjacent block-axis margins may collapse just like classic top/bottom margins.
shorthand
Physical margin can override
A later margin shorthand sets all four physical sides and can wipe logical longhands depending on cascade order.
support
Newer than classic margin
Safe in modern browsers (about 2021+). For very old IE-only targets, use physical margin-top / margin-bottom.
pair
Remember the inline axis
margin-block does not set left/right in horizontal mode. Use margin-inline for that axis.
Compatibility
Browser Support
margin-block is a browser CSS property (logical box model). Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
margin-block
Supported in modern browsers since about April 2021. Part of CSS Logical Properties and Values.
95%Modern support
Google Chrome87+
Full support
Mozilla Firefox66+
Full support
Apple Safari14.1+
Full support
Microsoft Edge87+
Full support
Opera73+
Full support
Samsung Internet14+
Full support
Internet Explorer—
No support
margin-blockModern browsers
Bottom line: Safe for modern sites. Fall back to margin-top/margin-bottom only if you must support Internet Explorer. It is not a runtime API.
Remember
Key Takeaways
Role: shorthand for block-start and block-end outer margins.
Logical: follows writing mode — not locked to physical top/bottom.
Values: one for both sides, or two for start then end.
Pair: use margin-inline for the other axis.
One line:margin-block sets start/end margins on the block axis — writing-mode aware spacing.
Frequently Asked Questions
It is a shorthand for margin-block-start and margin-block-end. It sets outer spacing on the block axis, which maps to physical sides based on writing mode.
Each longhand defaults to 0, so there is no block-axis margin until you set one.
margin-top and margin-bottom always mean physical top and bottom. margin-block follows the writing mode, so in horizontal text it is usually top/bottom, and in vertical text it can map to left/right.
Yes. One value sets both start and end. Two values set start, then end.
Use it when vertical (block-axis) spacing should stay correct if writing-mode or direction changes, especially in multilingual layouts.
It is Baseline and widely available in modern browsers since about April 2021. It is a browser CSS property, not a Node.js feature.