The margin-block-end property sets outer spacing on the block-end side of an element using logical layout instead of physical bottom margin.
01
Block-End
End of block axis.
02
Logical
Writing-mode aware.
03
Longhand
One side only.
04
Stack spacing
Gap after items.
05
RTL safe
International layouts.
06
Default 0
No spacing.
Fundamentals
Introduction
The margin-block-end property in CSS is part of the logical properties and values module, which allows for writing CSS in a way that is more consistent across different writing modes, such as left-to-right, right-to-left, and vertical text.
This property sets the margin at the end of the block axis, which can be at the bottom or top of the element, depending on the writing mode.
Definition and Usage
Apply margin-block-end when you need spacing after an element on the block axis without affecting the block-start side. Common uses include separating stacked cards, paragraphs, form fields, and section blocks.
💡
Beginner Tip
In normal horizontal English pages, margin-block-end: 20px behaves like margin-bottom: 20px. The advantage appears when writing mode or direction changes.
Foundation
📝 Syntax
The syntax for the margin-block-end property is simple. It can accept a variety of length units or keywords to define the margin size.
syntax.css
element{margin-block-end:value;}
Basic Example
margin-block-end.css
p{margin-block-end:20px;}
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
0
Applies to
All elements except table display types that use separate border model
Inherited
No
Animatable
Yes, as a length
Related shorthand
margin-block
Reference
💎 Property Values
Value
Example
Meaning
Length
margin-block-end: 20px;
Fixed margin using px, em, rem, etc.
Percentage
margin-block-end: 5%;
Margin as a percentage of the containing block width
auto
margin-block-end: auto;
The browser calculates the margin automatically
initial
margin-block-end: initial;
Sets the property to its default value (0)
inherit
margin-block-end: inherit;
Inherits the property value from the parent element
block-end
Default
🎯 Default Value
The default value for margin-block-end is 0, meaning no margin is applied by default. Override it when you need spacing after an element on the block axis.
Preview
👀 Live Preview
A box with block-end margin above a note element:
margin-block-end: 1.25rem
Space appears after the blue box on the block axis.
Hands-On
Examples Gallery
Add block-end margin to a paragraph, space stacked cards, see writing-mode behavior, and compare with physical margin-bottom.
🔢 Block-End Spacing
Start with the reference example — add margin at the end of the block axis on a paragraph.
Example 1 — Paragraph Block-End Margin
Set a margin at the end of the block axis for a paragraph. Depending on the writing mode, this margin could appear at the bottom or top of the paragraph.
margin-block-end.html
<style>p{margin-block-end:20px;}</style><p>This paragraph has a margin block end of 20px.</p><p>The next paragraph follows after the block-end gap.</p>
Avoid negative margins on focusable elements — Negative block-end margins can overlap the next interactive control.
Test zoom and small screens — Large block-end margins can push content off-screen on narrow viewports.
Use semantic HTML — Margins adjust spacing; structure still comes from proper elements.
🧠 How margin-block-end Works
1
You set block-end spacing
Apply margin-block-end with a length, percentage, or keyword.
CSS rule
2
Browser resolves block-end
The block-end side is determined by writing mode and text direction.
Logical layout
3
Outer space is added
Transparent margin appears after the element on the block axis.
Box model
=
↓
Clear separation
Content after the element is pushed away on the block axis.
Compatibility
🖥 Browser Compatibility
The margin-block-end property is widely supported in modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it’s always advisable to test your website across different browsers and devices to ensure full compatibility.
✓ Modern browsers · Logical properties
Reliable in current browser versions
margin-block-end is part of the CSS Logical Properties module. Use it in modern projects; provide physical fallbacks only if you must support very old browsers.
96%Global browser support
Google Chrome87+ · Desktop & Mobile
Full support
Mozilla Firefox66+ · Desktop & Mobile
Full support
Apple Safari14.1+ · macOS & iOS
Full support
Microsoft Edge87+ · Chromium
Full support
Opera73+ · Modern
Full support
margin-block-end property96% supported
Bottom line: Safe for modern sites. For block-start spacing, see margin-block-start.
Wrap Up
🎉 Conclusion
The margin-block-end property is a versatile tool for web developers looking to manage margins in a logical and writing-mode-aware manner.
This property is particularly useful in internationalized websites, where text direction can vary significantly. By using logical properties like margin-block-end, you can ensure your layouts remain consistent and accessible across different writing systems.
Use margin-block-end for spacing between stacked sections
Prefer rem for scalable block-end spacing
Pair with logical padding for consistent layouts
Test in RTL and vertical writing modes for international UIs
Use with semantic block elements like sections and articles
❌ Don’t
Assume block-end always means bottom in every layout
Mix logical and physical margins on the same axis without reason
Use huge fixed margins that break mobile layouts
Forget margin collapse between stacked block elements
Skip browser testing for older Safari versions
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about margin-block-end
Use these points when spacing elements on the block-end side.
5
Core concepts
↓01
Block-End
End of axis.
Purpose
002
Default 0
No spacing.
Default
LH03
Longhand
One side.
Type
wm04
Writing mode
Adapts flow.
Logical
i18n05
RTL safe
Global layouts.
Use case
❓ Frequently Asked Questions
The margin-block-end property sets outer spacing on the block-end side of an element. In horizontal left-to-right writing, that is usually the bottom margin.
The default value is 0, meaning no block-end margin unless you set one explicitly.
margin-bottom always targets the physical bottom edge. margin-block-end follows the writing mode, so spacing stays correct when text flow or direction changes.
margin-block is shorthand for margin-block-start and margin-block-end. Use margin-block-end when you only need spacing on the block-end side.
Use it for spacing after an element on the block axis, such as gap between stacked sections, cards, or paragraphs in multilingual layouts.