scroll-margin-inline-end

Sets the snap margin at the 'end' of an element in the text flow (usually the right side in English). It ensures a gap between the element and the edge of the scroll container when it snaps.

Quick example

.snap-card {
  /* Adds a 20px gap to the right when snapping in a horizontal slider */
  scroll-margin-inline-end: 20px;
  scroll-snap-align: end;
}

Quick facts

Initial value
0
Inherited
No
Applies to
all elements
Animation type
byComputedValueType

scroll-margin-inline-end Browser Support

Widely available Since 2020 95% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2020.

Safe to use without fallbacks.

69+
68+
15+
79+
ESC