In a horizontal writing mode that usually means left and right. It is not inherited. Both longhands start at 0. Pair it with scroll-snap-type on the container and scroll-snap-align on the target.
Logical shorthand.
Standard-track and Baseline Widely available. Prefer it over physical left/right margins when the layout may switch writing mode. It accepts lengths only — not percentages.
The formal syntax is lengths only. Use px, rem, or em — not %.
vs
Not the same as scroll-padding-inline
scroll-padding-inline insets the scroll container’s snapport. scroll-margin-inline expands the target’s snap area.
axis
Inline follows writing mode
In vertical writing modes the inline axis is vertical, so this property offsets top/bottom instead of left/right.
edge
Only the snapped edge feels obvious
If you snap to end, the end margin is what you notice. Setting only that longhand is often enough.
Compatibility
Browser Support
scroll-margin-inline is a browser layout property for scroll snap. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available since 2021
scroll-margin-inline
Chrome 69+, Firefox 68+, Safari 15+, Edge 79+, Opera 56+, Samsung Internet 10.1+. Internet Explorer does not support it.
97%Modern browsers
Google Chrome69+
Full support
Mozilla Firefox68+
Full support
Apple Safari15+
Full support
Microsoft Edge79+
Full support
Opera56+
Full support
Samsung Internet10.1+
Full support
Internet ExplorerNo support
Not supported
scroll-margin-inlineWidely supported
Bottom line: Safe for modern scroll-snap UIs. Skip Internet Explorer. Pair with scroll-snap-type and scroll-snap-align or the offset will not show.
Remember
Key Takeaways
Role: shorthand for inline-start and inline-end scroll margins on a snap target.
Values: one length for both sides, or two lengths for start then end.
Initial value:0 on both longhands. Not inherited. No percentages.
Tip: use scroll-padding-inline on the container when you want to inset the snapport instead.
One line:scroll-margin-inline gives a snap target breathing room on the inline axis — after scroll snap is already set up.
Frequently Asked Questions
It is a shorthand that sets scroll margins on the inline axis — scroll-margin-inline-start and scroll-margin-inline-end. Those outsets enlarge the scroll snap area so snapping stops a little before or after the element's edge.
Both longhands default to 0. There is no extra inset until you set one.
It mainly affects scroll snapping. You still need a scroll container with scroll-snap-type and snap targets with scroll-snap-align for the offset to show during snap scrolling.
scroll-margin-inline is set on the snap target (the child). scroll-padding-inline is set on the scroll container and insets the snapport itself.
No. Set it on the element that snaps. Percentages are not valid; use lengths such as px, rem, or em.
It is Baseline and widely available: Chrome 69+, Firefox 68+, Safari 15+, Edge 79+, Opera 56+. Internet Explorer does not support it. It is a browser layout property, not a Node.js feature.