CSS scroll-margin-block-end property
The scroll-margin-block-end property is used to set all the scroll margins to the end side of a scroll element at once. This property defines the margin of the scroll snap area at the end of the block dimension that is used for snapping this box to the snap port.
scroll-margin-block-end: length /* Or */ scroll-margin-block-end: 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-end doesn’t accept percentage value as the length.
Example: In this example, you can see the effect of scroll-margin-block-end by scrolling to a point partway between two of the “interfaces” of the example’s content.
Output: This example shows a snapping area of 90px on scrolling.