CSS scroll-margin-right Property

❮ Previous Reference Next ❯

Example

.scroller > div:nth-child(2) {
  scroll-margin-right: 1rem;
}

.scroller > div:nth-child(3) {
  scroll-margin-right: 2rem;
}





1
2
3

Meaning:

The scroll-margin-right CSS property defines the right margin of the scroll snap area 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:
object.style.scrollMarginRight="length|initial|inherit|revert|revert-layer|unset";



Standard Syntax

scroll-margin-right: 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 right 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-right: 0;
}
❮ Previous Reference Next ❯