The margin-block-start property sets outer spacing on the block-start side of an element using logical layout instead of physical top margin.
01
Block-Start
Start of block axis.
02
Logical
Writing-mode aware.
03
Longhand
One side only.
04
Offset
Space before items.
05
RTL safe
International layouts.
06
Default 0
No spacing.
Fundamentals
Introduction
The margin-block-start property in CSS is used to set the margin at the start of an element’s block, depending on the writing mode, directionality, and text orientation.
This property is part of the logical properties and values, which are designed to work with different writing modes and text directions, such as left-to-right (LTR) or right-to-left (RTL).
Definition and Usage
Apply margin-block-start when you need spacing before an element on the block axis without affecting the block-end side. Common uses include offsetting content below a heading, adding space above a section, or creating rhythm in stacked layouts.
💡
Beginner Tip
In normal horizontal English pages, margin-block-start: 20px behaves like margin-top: 20px. The advantage appears when writing mode or direction changes.
Foundation
📝 Syntax
The syntax for the margin-block-start property allows you to set a margin value in various units, such as pixels, ems, percentages, etc.
syntax.css
element{margin-block-start:value;}
Here, value can be a length, percentage, or one of the global values like auto, inherit, initial, or unset.
Basic Example
margin-block-start.css
p{margin-block-start: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-start: 20px;
Fixed margin in px, em, rem, cm, pt, etc.
Percentage
margin-block-start: 5%;
Margin as a percentage of the containing block width
auto
margin-block-start: auto;
The browser calculates the margin
inherit
margin-block-start: inherit;
Inherits the margin value from the parent element
initial
margin-block-start: initial;
Sets the margin to its default value (0)
unset
margin-block-start: unset;
Resets the margin to its natural value
block-start
Default
🎯 Default Value
The default value of the margin-block-start property is 0, meaning there is no margin applied by default at the start of the block. Override it when you need spacing before an element on the block axis.
Preview
👀 Live Preview
A note above a box with block-start margin:
Content above the box
margin-block-start: 1.25rem
Hands-On
Examples Gallery
Add block-start margin to a paragraph, offset sections below headings, see writing-mode behavior, and compare with physical margin-top.
🔢 Block-Start Spacing
Start with the reference example — add margin at the start of the block axis on a paragraph.
Example 1 — Paragraph Block-Start Margin
In this example, we set a margin of 20 pixels at the start of the block for a paragraph element.
margin-block-start.html
<style>p{margin-block-start:20px;}</style><h1>Example of margin-block-start</h1><p>This paragraph has a 20px margin at the start of the block.</p>
Avoid negative margins on focusable elements — Negative block-start margins can overlap previous interactive controls.
Test zoom and small screens — Large block-start margins can push content off-screen on narrow viewports.
Use semantic HTML — Margins adjust spacing; structure still comes from proper elements.
🧠 How margin-block-start Works
1
You set block-start spacing
Apply margin-block-start with a length, percentage, or keyword.
CSS rule
2
Browser resolves block-start
The block-start side is determined by writing mode and text direction.
Logical layout
3
Outer space is added
Transparent margin appears before the element on the block axis.
Box model
=
↑
Clear offset
Content before the element stays separated on the block axis.
Compatibility
🖥 Browser Compatibility
The margin-block-start property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. As always, testing across different browsers ensures consistent behavior.
✓ Modern browsers · Logical properties
Reliable in current browser versions
margin-block-start 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-start property96% supported
Bottom line: Safe for modern sites. For block-end spacing, see margin-block-end.
Wrap Up
🎉 Conclusion
The margin-block-start property is a useful tool for managing margins in a way that respects the writing mode and direction of the content.
It provides more flexibility and control over layout adjustments, especially in multilingual websites or applications. Experiment with different margin values to see how this property can enhance the spacing and layout of your web projects.
Test in RTL and vertical writing modes for international UIs
Combine with margin-block-end for full block-axis control
❌ Don’t
Assume block-start always means top 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-start
Use these points when spacing elements on the block-start side.
5
Core concepts
↑01
Block-Start
Start 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-start property sets outer spacing on the block-start side of an element. In horizontal left-to-right writing, that is usually the top margin.
The default value is 0, meaning no block-start margin unless you set one explicitly.
margin-top always targets the physical top edge. margin-block-start 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-start when you only need spacing on the block-start side.
Use it for spacing before an element on the block axis, such as offset below a heading, space above a section, or gap before stacked content in multilingual layouts.