Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2022.
The scroll-snap-type CSS property is set on a scroll container, opting it into scroll snapping by setting the direction and strictness of snap point enforcement within the snap port.
If the content in the scroll port changes — for example, if content is added, moved, deleted, or resized — the scroll container will re-snap to the previously snapped content if that content is still present.
If the value of a scroll snap-related property, such as scroll-snap-type or scroll-margin, is changed, the scroll container will re-snap based on the current value of scroll-snap-type.
Specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.
When the visual viewport of this scroll container is scrolled, it must ignore snap points.
xThe scroll container snaps to snap positions in its horizontal axis only.
yThe scroll container snaps to snap positions in its vertical axis only.
blockThe scroll container snaps to snap positions in its block axis only.
inlineThe scroll container snaps to snap positions in its inline axis only.
bothThe scroll container snaps to snap positions in both of its axes independently (potentially snapping to different elements in each axis).
mandatoryThe visual viewport of this scroll container must snap to a snap position if it isn't currently scrolled.
proximityThe visual viewport of this scroll container may snap to a snap position if it isn't currently scrolled. The user agent decides if it snaps or not based on scroll parameters. This is the default snap strictness if any snap axis is specified.
| none |
| all elements |
| no |
| as specified |
| discrete |
| CSS Scroll Snap Module Level 1 # scroll-snap-type |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 20, 2026 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.