CSS scroll-margin-block-start property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxNot supported
Internet ExplorerNot supported
EdgeNot supported
OperaNot supported
Description
CSS scroll-margin-block-start property specifies the margin at the start side of the scroll item. Please move the scrollbar to see the effect of margin.
The selection of start side depends upon the writing-mode.
The start side represents top side for the horizontal-tb writing-mode.
The start side represents right or left side for the vertical-rl or vertical-lr writing-mode respectively.
Syntax
scroll-margin-block-start :+ve length
Property values
+ve length Default
-
There is no margin at the start edge of the scroll snap area.
- Try it
scroll-margin-block-start: 0px; +ve length
-
It specifies the start edge offset of the scroll item.
In the demo, there is 100px margin at the start edge of the scroll snap area.
- Try it
scroll-margin-block-start: 100px;
Applicable to
It applies to scroll containers.