CSS scroll-margin-block-start Property
Example
.scroller > div:nth-child(2) {
scroll-margin-block-start: 1rem;
}
.scroller > div:nth-child(3) {
scroll-margin-block-start: 2rem;
}
1
2
3
Meaning:
The scroll-margin-block-start CSS 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 snapport.
The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets.
Default value: | 0 |
Inherited: | No |
Animatable: | No |
Version: | CSS3 |
JavaScript syntax: |
|
Standard Syntax
scroll-margin-block-start: length|initial|inherit|revert|revert-layer|unset;
Browser Support
Status
Property Values
The following table describes the values of this property:
Value | Description |
---|---|
length | An outset from the block start edge of the scroll container. |
initial | Sets this property to its default value. |
inherit | If specified, the associated element takes the computed value of its parent element animation-delay property. |
revert | Reverts the cascaded value of the property from its current value to the value the property |
revert-layer | Rollback styles to the ones specified in previous cascade layers. |
unset | Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not. |
Default CSS Property Values
selectors {
scroll-margin-block-start: 0;
}