CSS-only Interactive, Swipeable Image Carousel

Mate Marschalko
9 min readMay 5, 2021

Let’s build a simple, no-JavaScript carousel you can swipe on both mobile and desktop. We will even add deep-linking to individual slides from buttons or unique URLs!

All you need is HTML and CSS

This is an example project from my book, All you need is HTML and CSS:

There are many other examples in the book pushing the limits of HTML and CSS including interactive carousels, accordions, calculating, counting, advanced input validation, state management, dismissible modal windows, and reacting to mouse and keyboard inputs. There’s even an animated pure CSS clock (analogue and digital) and a fully working star rating widget!

Linking with the anchor element

--

--

Mate Marschalko
Mate Marschalko

Written by Mate Marschalko

Senior Creative Developer, Generative AI, Electronics with over 15 years experience | JavaScript, HTML, CSS

Responses (1)