Module 15 · Lesson 2 of 458/60 in the course~20 min
Module lessons (2/4)
Zero-JS Carousels With scroll-snap & scrollbar-gutter
Lesson preview6 hands-on exercises readyModern HTML & CSS · CSS Architecture at Scale: @scope, Scroll Snap & Systems
Build smooth touch-friendly horizontal rails using scroll-snap-type, scroll-padding-inline, overscroll containment, and keyboard focusability.
What you'll learn in this lesson
- Build silky, momentum-aware card carousels in pure CSS using
scroll-snap-type,scroll-snap-align, andscroll-padding-inline. - Prevent awkward page jumps and stuck sticky-header anchors with
scrollbar-gutter: stableandscroll-margin-top. - Keep scrollable horizontal regions keyboard reachable (
tabindex="0",aria-label) without triggering outer body overflow at375px.
Overview
Swipeable product shelves and horizontal tag strips no longer require touch listeners or carousel plugins. Five native declarations create physics-friendly scrolling across mobile touchscreens and desktop trackpads:
Sections covered in this lesson
- 1Zero-JS Smooth Touch Carousels
Pro Lesson · CSS Architecture at Scale: @scope, Scroll Snap & Systems
Unlock "Zero-JS Carousels With scroll-snap & scrollbar-gutter" and the full Modern HTML & CSS curriculum
Build smooth touch-friendly horizontal rails using scroll-snap-type, scroll-padding-inline, overscroll containment, and keyboard focusability.
Unlock all 6 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Modern HTML & CSS plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.