22 Pure CSS6 with JSPublished 2026-10-05Free · no sign-up
Hover effects for clickable cards, from subtle to playful: zooms and underlines, gradient borders, 3D tilt cards that follow the pointer, stacked cards that fan out, and animated cards. The core set: hover effects for clickable cards: a blog card whose image zooms and title underlines, a gradient border that fades in, an arrow that slides into the corner, a description that expands, paper layers that spread behind the card, a background that shifts tone and an option card that dips when pressed.
A blog card where hover zooms the cover image and underlines the title, two cues that the whole card is clickable. The title is the link, stretched over the card, and the underline is a native text-decoration so it wraps across lines.
A plain dark card whose border fades into a gradient on hover. The gradient border is always there, on a masked pseudo-element at zero opacity; hover only changes opacity, which is far cheaper than swapping backgrounds.
View code
<a class="chv2" href="#api"><b>API access</b><span>Build on top of your store data.</span></a>
A small arrow slides in diagonally from the top right corner on hover, a modern cue for cards that link elsewhere. The arrow is aria-hidden decoration and the card's text is the link name.
View code
<a class="chv3" href="#case"><span class="ar" aria-hidden="true">↗</span><b>Case study</b><span>How Linea doubled repeat orders.</span></a>
The card shows a title and a teaser; hover or focus reveals a longer description by animating grid rows from 0fr to 1fr. The full text is always in the DOM, so screen readers get it whatever the visual state.
View code
<a class="chv4" href="#course"><b>CSS layout course</b><span class="tz">Six lessons, one weekend.</span><span class="more"><span>Grid, flexbox, container queries and subgrid, each with exercises and a final project.</span></span></a>
On hover, two paper-like layers spread out from behind the card, as if a stack of pages fanned slightly. They are pseudo-elements that sit behind the card through isolation and move with small rotations and offsets.
A feature card whose background gradient slides to reveal a brighter tone while its icon lifts and turns slightly. Both changes are on hover and focus, and the card's contrast passes in both states because the text is white on dark tones throughout.
View code
<a class="chv6" href="#automation"><span class="ic" aria-hidden="true">⚙</span><b>Automation</b><span>Rules that run while you sleep.</span></a>
A selectable option card that dips slightly when pressed and lifts back on release, giving tactile feedback on touch screens where hover does not exist. It is a label for a radio button, so selection works with the keyboard too.
View code
<fieldset class="chv7"><legend>Delivery</legend><label><input type="radio" name="chv7" checked><b>Standard</b><span>3-5 days · Free</span></label><label><input type="radio" name="chv7"><b>Express</b><span>Next day · $9</span></label></fieldset>
The card rises a few pixels and its shadow deepens on hover, while the image area zooms slightly inside a fixed frame. The whole card is one link, so the hover and focus states belong to the same element and the click target is generous.
A destination card that shows only the title until hovered or focused, when a panel with the description and a link slides up. The panel uses :focus-within as well as :hover, so keyboard users reach the link and the details appear for them too. On touch screens the panel is always shown.
View code
<article class="ac2"><div class="bg" aria-hidden="true"></div><div class="panel"><h3>Lofoten, Norway</h3><div class="more"><div><p>Fishing villages under steep peaks, best from June to August.</p><a href="#lofoten">Read the guide</a></div></div></div></article>
Three stat cards fade and rise into place one after another when the page loads, using one keyframe animation and a custom property for each card's delay. The final state is the normal layout, so nothing is hidden if the animation never runs.
A soft light follows the pointer across a dark feature card. Script stores the pointer position in two custom properties and a radial gradient in a pseudo-element reads them, so the effect costs one style update per move. It fades out when the pointer leaves.
View code
<article class="ac4"><h3>Instant previews</h3><p>Every change you make shows up in the preview before you finish typing.</p></article>
var c = document.querySelector('.ac4');
c.addEventListener('pointermove', function (e) {
var r = c.getBoundingClientRect();
c.style.setProperty('--x', e.clientX - r.left + 'px');
c.style.setProperty('--y', e.clientY - r.top + 'px');
});
12. Expanding Card with details
CardDisclosure
A plan card built on details and summary, so expanding it needs no script and works with the keyboard. The extra rows animate open with interpolate-size where the browser supports it, and simply appear elsewhere. The chevron turns with the open state.
A collectible-style card with a rainbow sheen that slides across it on hover. The sheen is a wide repeating gradient in a blended pseudo-element whose background-position moves, so no image or canvas is needed.
A recipe card whose cover folds up on hover or focus to reveal the ingredients, using a 3D rotation around the top edge. The back content is in the DOM all the time, so screen readers read both faces in order regardless of the animation.
The card rotates on two axes to face the pointer, with perspective on the parent. Script converts the pointer position into two angles of at most 10 degrees, stored in custom properties, and the card eases back flat when the pointer leaves. It does nothing for reduced motion.
View code
<div class="tc1"><article class="card"><p class="k">New</p><h3>Aurora headphones</h3><p>40 hours of battery, folding frame.</p></article></div>
var c = document.querySelector('.tc1 .card');
if (!matchMedia('(prefers-reduced-motion: reduce)').matches) {
c.addEventListener('pointermove', function (e) {
var r = c.getBoundingClientRect(), x = (e.clientX - r.left) / r.width - .5, y = (e.clientY - r.top) / r.height - .5;
c.classList.add('live');
c.style.setProperty('--ry', x * 20 + 'deg'); c.style.setProperty('--rx', -y * 20 + 'deg');
});
c.addEventListener('pointerleave', function () { c.classList.remove('live'); c.style.setProperty('--rx', '0deg'); c.style.setProperty('--ry', '0deg'); });
}
16. CSS-Only Tilt with Hover Zones
3DNo JS
No script: nine invisible zones cover the card in a grid, and hovering a zone tilts the card toward it with :has(). It is a useful trick when you cannot add JavaScript. The zones are empty elements hidden from assistive technology.
View code
<div class="tc2"><div class="z" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div><article><h3>Hover the corners</h3><p>The card leans toward the zone under the pointer.</p></article></div>
On top of the tilt, a soft white glare moves to the side nearest the pointer, as if light were catching a glossy surface. The glare is a radial gradient on a pseudo-element positioned by the same custom properties the tilt uses.
View code
<div class="tc3"><article class="card"><h3>Night pass</h3><p>Valid 18:00 to 06:00</p></article></div>
var c = document.querySelector('.tc3 .card'), still = matchMedia('(prefers-reduced-motion: reduce)').matches;
c.addEventListener('pointermove', function (e) {
var r = c.getBoundingClientRect(), x = (e.clientX - r.left) / r.width, y = (e.clientY - r.top) / r.height;
c.style.setProperty('--gx', x * 100 + '%'); c.style.setProperty('--gy', y * 100 + '%');
if (!still) { c.style.setProperty('--ry', (x - .5) * 16 + 'deg'); c.style.setProperty('--rx', (.5 - y) * 16 + 'deg'); }
});
c.addEventListener('pointerleave', function () { c.style.setProperty('--rx', '0deg'); c.style.setProperty('--ry', '0deg'); });
18. Layered Depth on Hover
3DParallax
Elements inside the card sit at different depths with translateZ inside a preserve-3d parent, so when the card tilts on hover the badge and title move more than the background. It gives a pop-up-book feeling with a single fixed rotation and no script.
View code
<div class="tc4"><article class="card"><span class="badge">-30%</span><h3>Linen shirt</h3><p>Summer sale ends Sunday</p></article></div>
A credit-card-sized mock-up that tilts toward the pointer and shows a diagonal sheen. The number is fake and shortened to the last four digits, which is also what you should show on a real account page. aspect-ratio keeps the 85.6 by 54 mm card proportions at any width.
var c = document.querySelector('.tc5 .cc');
if (!matchMedia('(prefers-reduced-motion: reduce)').matches) {
c.addEventListener('pointermove', function (e) {
var r = c.getBoundingClientRect();
c.style.setProperty('--ry', ((e.clientX - r.left) / r.width - .5) * 18 + 'deg');
c.style.setProperty('--rx', (.5 - (e.clientY - r.top) / r.height) * 18 + 'deg');
});
c.addEventListener('pointerleave', function () { c.style.setProperty('--rx', '0deg'); c.style.setProperty('--ry', '0deg'); });
}
20. Tilt on Keyboard Focus Too
3DAccessibility
Three linked cards that tilt slightly when hovered or focused, so keyboard users get the same feedback as mouse users. The tilt is a fixed CSS rotation on :hover and :focus-visible, which needs no script and is easy to switch off for reduced motion.
The card floats slowly up and down while a separate shadow ellipse beneath it shrinks and softens in step, which sells the height far better than a box-shadow alone. Both use the same duration and easing so they stay in sync.
View code
<div class="tc7"><article><h3>Pro plan</h3><p>Everything in Team, plus audit logs.</p></article><span class="sh" aria-hidden="true"></span></div>
Three cards sit on top of each other, slightly rotated like a held hand of cards, and fan out further on hover or focus. Each card's rotation comes from a custom property, so changing the angle in one place changes the whole fan.
A deck of tip cards where the top card slides away and moves to the back when you press Next. The deck order is real DOM order, so screen readers read the card on top first, and a live region announces which tip is showing.
View code
<div class="sc2"><div class="deck"><article>Tip 1: Name buttons after what they do.</article><article>Tip 2: Keep line length near 65 characters.</article><article>Tip 3: Test with the keyboard first.</article></div><div class="row"><p aria-live="polite">Tip 1 of 3</p><button type="button">Next tip</button></div></div>
var d = document.querySelector('.sc2 .deck'), p = document.querySelector('.sc2 p'), n = 1, busy = false;
document.querySelector('.sc2 button').onclick = function () {
if (busy) return; busy = true;
var top = d.firstElementChild; top.classList.add('out');
setTimeout(function () { top.classList.remove('out'); d.appendChild(top); n = n % 3 + 1; p.textContent = 'Tip ' + n + ' of 3'; busy = false; }, 350);
};
24. Cards That Stack While Scrolling
StackSticky
Inside a scrolling panel, each card is position: sticky with a slightly larger top offset than the last, so cards pile up on each other as you scroll and leave a sliver of each one visible. It is pure CSS and works with the scroll wheel, keyboard and touch.
View code
<div class="sc3" tabindex="0" role="region" aria-label="Project stages, scrollable"><article style="--i:0;--c:#1e3a8a"><h3>Discover</h3><p>Workshops and research.</p></article><article style="--i:1;--c:#5b21b6"><h3>Design</h3><p>Wireframes and visual design.</p></article><article style="--i:2;--c:#9d174d"><h3>Build</h3><p>Front end and integrations.</p></article><article style="--i:3;--c:#065f46"><h3>Launch</h3><p>Testing, training and go-live.</p></article></div>
Four small cards are piled up with negative margins and spread into a neat row when the group is hovered or focused, like a tidy hand of cards. The cards are list items, so the list is announced with its count.
Notification cards collapse into a neat stack with only the edges of older ones peeking out, and expand into a list when the button above them is pressed. The button has aria-expanded, so the collapsed and expanded states are announced.
View code
<div class="sc5"><button type="button" aria-expanded="false" aria-controls="sc5l">3 notifications</button><ul id="sc5l"><li><b>Order shipped</b>Your parcel is on its way.</li><li><b>New review</b>“Lovely mug!” 5 stars.</li><li><b>Payout sent</b>$420 to your bank.</li></ul></div>
var w = document.querySelector('.sc5'), b = w.querySelector('button');
b.onclick = function () { var o = w.classList.toggle('open'); b.setAttribute('aria-expanded', o); };
27. Polaroid Photo Pile
StackGallery
Three instant-photo frames lie on a pile at different angles, and the one under the pointer straightens and rises to the top with a higher z-index. The photos are gradient stand-ins with captions in figcaption elements.
A single pricing card with two offset layers behind it, a quiet way to make the recommended plan feel weightier than its neighbours. The layers are two pseudo-elements, so the markup is just the card.
View code
<article class="sc7"><p class="tag">Most popular</p><h3>Growth</h3><p class="pr"><b>$29</b> / month</p><p class="d">For shops doing their first thousand orders.</p></article>
Make the card's title the link and stretch it with a pseudo-element, or make the whole card a single link if it has no other controls. Never nest links or buttons inside another link.
Show focus on the card
When the title link is focused, use :has(a:focus-visible) on the card to outline the whole card, so keyboard users see the same target that mouse users hover.
Prepare the effect, toggle opacity
Expensive styling such as a masked gradient border can sit on a pseudo-element at zero opacity and fade in on hover. Toggling opacity is cheaper than recalculating backgrounds.
Touch needs feedback too
Without hover, a pressed state matters. A slight scale on :active confirms the tap on phones.
Frequently asked questions
How is this page different from animated cards?
Animated cards covers entrances and reveals; this page is about the hover and press response of link cards.
Will the stretched link break text selection?
It covers the card, so text cannot be selected by dragging. That is usually fine for short card text.
Can I combine two effects?
Yes, for example zoom and arrow. Keep the total motion small.