CSS scroll-margin-block-start property
The scroll-margin-block-start property is used to set all the scroll margins to the start side of a scroll element at once. This property defines the margin of the scroll snap area at the start of the block dimension that is used for snapping this box to the snap port.
scroll-margin-block-start: length /* Or */ scroll-margin-block-start: Global_Values
Property values: This property accepts two properties mentioned above and described below:
- length: This property refers to the values defined with length units like em, px, rem, vh, etc.
- Global_Values: This property refers to the global values like inherit, initial, unset, etc.
Note: scroll-margin-block-start doesn’t accept percentage value as the length.
Example: In this example, you can see the effect of scroll-margin-block-start by scrolling to a point partway between two of the “interfaces” of the example’s content.