scroll-snap-type
Enables scroll snapping on a container, forcing the scroll position to 'snap' to certain elements. It converts a smooth scroll into a stepped, slider-like experience.
Quick example
.carousel-container {
display: flex;
overflow-x: auto;
scroll-snap-type: x mandatory;
/* ensures the scroll always stops exactly on a child element */
} Quick facts
Initial value
noneInherited
No
Applies to
all elements
Animation type
discrete
Values
noneblockinlinebothmandatoryproximity scroll-snap-type 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+
99+
11+
79+