This is the definitive implementation reference for HTML + CSS carousels — written so a developer (or an AI agent) can follow it from zero to a fully working carousel without touching JavaScript. ## What You Are Building A responsive carousel with: - Swipe / drag between slides (touch and mouse) - Pagination dots that highlight the current slide - Previous / Next navigation buttons - Smooth scroll animation - Zero JavaScript ## Browser Support (2026) The table below reflects what each feature requires: | Feature | API | Chrome | Edge | Firefox | Safari | |---------|-----|--------|------|---------|--------| | Scroll snap | `scroll-snap-type` | 69+ | 79+ | 68+ | 11+ | | Pagination dots | `::scroll-marker` | 135+ | 135+ | flag | 18.2+ | | Prev/Next buttons | `::scroll-button()` | 135+ | 135+ | flag | 18.2+ | | Active dot style | `:target-current` | 135+ | 135+ | flag | 18.2+ | **Global baseline:** Scroll snap works everywhere (~97% of browsers). Scroll markers and buttons add progressive enhancement for ~75% of users and growing. --- ## Step 1 — The HTML Structure Start with the smallest valid markup: ```html ``` **Rules for AI agents generating this markup:** - The outer element is the scroll container — apply all scroll CSS to it. - Each direct child is a slide — apply snap CSS to each child. - No wrappers, no JavaScript hooks, no `data-*` attributes needed. - Do not add prev/next `