← All elements
<div class="cfl"><input type="radio" name="cfl" id="cf1"><input type="radio" name="cfl" id="cf2"><input type="radio" name="cfl" id="cf3" checked><input type="radio" name="cfl" id="cf4"><input type="radio" name="cfl" id="cf5"><div class="st"><label for="cf1">1</label><label for="cf2">2</label><label for="cf3">3</label><label for="cf4">4</label><label for="cf5">5</label></div></div>About this carousel
Five tiles arranged in a 3D coverflow where choosing a dot rotates the chosen tile to the front.
How it works
Each tile computes its distance from the selected number using custom properties, and that distance drives its horizontal shift, depth and rotation. :has() sets the selected number from whichever radio is checked, and z-index is calculated the same way so the chosen tile is on top.
Ways to customise it
- Change the 62px spacing and -32 degree rotation.
- Replace the numbers with images or titles.
- Edit the 0.5s transition.
Good to know
The dots are real radios, so arrow keys move through the slides, and each tile is also a clickable label. The calculations rely on :has() and CSS max(), both supported in current browsers.
Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.