scroll-margin-inline
A shorthand that sets both the start and end scroll margins in the horizontal (inline) direction at once.
It is documented as part of the CSS Scroll Snap specification.
Syntax
/* Usage Example */
.gallery-image {
/* Adds a 1rem buffer on both the left and right sides when snapping */
scroll-margin-inline: 1rem;
}
/* Global values */
scroll-margin-inline: inherit;
scroll-margin-inline: initial;
scroll-margin-inline: revert;
scroll-margin-inline: revert-layer;
scroll-margin-inline: unset;
scroll-margin-inline 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.
69+
68+
15+
79+