π CSS Scroll Snap Explained
CSS Scroll Snap is a CSS specification that controls scroll snapping behavior, creating smooth, paged scrolling experiences.
Key Properties
- scroll-snap-type β Defines the axis direction (x/y/both/inline/block) and strictness (mandatory/proximity)
- scroll-snap-align β Sets alignment position on child elements (start/center/end)
- scroll-padding β Offsets the snap position from container edges
- scroll-margin β Offsets the snap position from child edges
Use Cases
- Image carousels and slideshows
- Horizontal paginated menus
- Photo galleries
- Timeline components
- Product browsing cards
Browser Support
All modern browsers (Chrome 69+, Firefox 68+, Safari 11+, Edge 79+) support CSS Scroll Snap.