CSS margin-block-start property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerNot supported
EdgeNot supported
OperaFully supports
Description
It is a logical property that defines space at the start side of a block. The selection of start side depends on the writing-mode.
It behaves like margin-top for the horizontal-tb writing mode.
-
It behaves like margin-right or margin-left for the vertical-rl and vertical-lr writing-mode respectively.
Change the direction of flow of text.
horizontal-tb vertical-lr vertical-rl
Syntax
margin-block-start : length
Property values
0 lengthDefault
-
There is no thickness of the margin area at the start side of the border box.
- Try it
margin-block-start: 0; +ve length
-
+ve value represents margin area at the start side of block.
- Try it
margin-block-start: 20px; -ve length
-
The space decreases by 20px at the start of block i.e the the subsequent content may merge into the element.
- Try it
margin-block-start: -20px;
Applicable to
It applies to all elements