Free ToolsGuidesCase StudiesResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/card-hover-effects

28 CSS Card Hover Effects

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.

01. Blog Card: Image Zoom, Title Underline

CardHover

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.

View code
<article class="chv1"><div class="fr"><div class="im" aria-hidden="true"></div></div><p class="k">Guides · 6 min</p><h3><a href="#post">How to price handmade products</a></h3></article>
.chv1 { position: relative; width: 260px; max-width: 100%; font-family: Inter, system-ui, sans-serif; }
.chv1 .fr { overflow: hidden; border-radius: 14px; }
.chv1 .im { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #fef3c7, #fdba74 50%, #ea580c); transition: transform .5s ease; }
.chv1 .k { margin: 10px 0 4px; color: #b54708; font-size: 12px; font-weight: 700; }
.chv1 h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.chv1 a { color: #101828; text-decoration: underline transparent; text-underline-offset: 3px; transition: text-decoration-color .25s; }
.chv1 a::after { content: ""; position: absolute; inset: 0; }
.chv1:hover .im, .chv1:has(a:focus-visible) .im { transform: scale(1.06); }
.chv1:hover a, .chv1 a:focus-visible { text-decoration-color: #101828; }
.chv1 a:focus-visible { outline: none; } .chv1:has(a:focus-visible) { outline: 3px solid #84adff; outline-offset: 6px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) { .chv1 .im { transition: none; } }

02. Gradient Border Reveal

CardBorder

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>
.chv2 { position: relative; display: grid; gap: 4px; width: 260px; max-width: 100%; box-sizing: border-box; padding: 20px; border: 1px solid #263048; border-radius: 16px; background: #111727; color: #94a3b8; font: 14px Inter, system-ui, sans-serif; text-decoration: none; }
.chv2 b { color: #f1f5f9; font-size: 16px; }
.chv2::before { content: ""; position: absolute; inset: -1px; padding: 1px; border-radius: inherit; background: linear-gradient(135deg, #22d3ee, #a855f7, #f43f5e); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); opacity: 0; transition: opacity .3s; pointer-events: none; }
.chv2:hover::before, .chv2:focus-visible::before { opacity: 1; }
.chv2:focus-visible { outline: 2px solid #a855f7; outline-offset: 4px; }

03. Corner Arrow Appears

CardIcon

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>
.chv3 { position: relative; display: grid; gap: 4px; width: 260px; max-width: 100%; box-sizing: border-box; padding: 20px 46px 20px 20px; border: 1px solid #e4e7ec; border-radius: 16px; background: #fff; color: #475467; font: 14px Inter, system-ui, sans-serif; text-decoration: none; overflow: hidden; transition: border-color .25s; }
.chv3 b { color: #101828; font-size: 16px; }
.chv3 .ar { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #101828; color: #fff; font-size: 14px; transform: translate(14px, -14px); opacity: 0; transition: transform .3s ease, opacity .3s; }
.chv3:hover, .chv3:focus-visible { border-color: #101828; }
.chv3:hover .ar, .chv3:focus-visible .ar { transform: none; opacity: 1; }
.chv3:focus-visible { outline: 3px solid #84adff; outline-offset: 3px; }
@media (hover: none) { .chv3 .ar { transform: none; opacity: 1; } }

04. Description Expands on Hover

CardReveal

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>
.chv4 { display: grid; gap: 4px; width: 260px; max-width: 100%; box-sizing: border-box; padding: 20px; border-radius: 16px; background: linear-gradient(160deg, #1e3a8a, #0f172a); color: #bfdbfe; font: 14px/1.5 Inter, system-ui, sans-serif; text-decoration: none; }
.chv4 b { color: #fff; font-size: 17px; }
.chv4 .more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.chv4 .more span { min-height: 0; overflow: hidden; color: #dbeafe; }
.chv4:hover .more, .chv4:focus-visible .more { grid-template-rows: 1fr; }
.chv4:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
@media (hover: none) { .chv4 .more { grid-template-rows: 1fr; } }
@media (prefers-reduced-motion: reduce) { .chv4 .more { transition: none; } }

05. Shadow Layers Spread

CardDepth

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.

View code
<a class="chv5" href="#notes"><b>Meeting notes</b><span>12 documents</span></a>
.chv5 { position: relative; isolation: isolate; display: grid; gap: 4px; width: 220px; max-width: 100%; box-sizing: border-box; padding: 20px; border: 1px solid #e4e7ec; border-radius: 14px; background: #fff; color: #475467; font: 14px Inter, system-ui, sans-serif; text-decoration: none; }
.chv5 b { color: #101828; font-size: 16px; }
.chv5::before, .chv5::after { content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid #e4e7ec; border-radius: inherit; background: #f9fafb; transition: transform .3s ease; }
.chv5:hover::before, .chv5:focus-visible::before { transform: translate(8px, 6px) rotate(3deg); }
.chv5:hover::after, .chv5:focus-visible::after { transform: translate(-6px, 8px) rotate(-3deg); }
.chv5:focus-visible { outline: 3px solid #84adff; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .chv5::before, .chv5::after { transition: none; } }

06. Background Shift and Icon Lift

CardColour

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>
.chv6 { display: grid; gap: 6px; width: 250px; max-width: 100%; box-sizing: border-box; padding: 20px; border-radius: 18px; background: linear-gradient(135deg, #1e1b4b 0 50%, #4338ca) 0 0 / 200% 200%; color: #c7d2fe; font: 14px Inter, system-ui, sans-serif; text-decoration: none; transition: background-position .5s ease; }
.chv6 b { color: #fff; font-size: 17px; }
.chv6 .ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.chv6:hover, .chv6:focus-visible { background-position: 100% 100%; }
.chv6:hover .ic, .chv6:focus-visible .ic { transform: translateY(-4px) rotate(-12deg); }
.chv6:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .chv6, .chv6 .ic { transition: none; } }

07. Pressable Card

CardActive

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>
.chv7 { display: grid; gap: 8px; width: 260px; max-width: 100%; min-inline-size: 0; margin: 0; padding: 0; border: 0; font: 14px Inter, system-ui, sans-serif; }
.chv7 legend { margin-bottom: 6px; padding: 0; color: #101828; font-weight: 800; }
.chv7 label { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 14px; border: 1px solid #d0d5dd; border-radius: 12px; background: #fff; color: #475467; cursor: pointer; transition: transform .12s ease, box-shadow .2s; }
.chv7 input { grid-row: span 2; align-self: center; margin: 0; accent-color: #101828; }
.chv7 b { color: #101828; }
.chv7 label:hover { box-shadow: 0 6px 14px -8px rgba(16,24,40,.35); }
.chv7 label:active { transform: scale(.98); }
.chv7 label:has(:checked) { border-color: #101828; box-shadow: 0 0 0 1px #101828; }
.chv7 label:has(:focus-visible) { outline: 3px solid #84adff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .chv7 label { transition: none; } .chv7 label:active { transform: none; } }

08. Lift and Zoom Product Card

CardHover

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.

View code
<a class="ac1" href="#lamp"><div class="img" aria-hidden="true"><span></span></div><div class="b"><p class="k">Lighting</p><h3>Arc floor lamp</h3><p class="p">$189</p></div></a>
.ac1 { display: block; width: 260px; max-width: 100%; box-sizing: border-box; border: 1px solid #e4e7ec; border-radius: 16px; background: #fff; color: #101828; text-decoration: none; overflow: hidden; font-family: Inter, system-ui, sans-serif; box-shadow: 0 1px 2px rgba(16,24,40,.06); transition: transform .3s ease, box-shadow .3s ease; }
.ac1 .img { height: 150px; overflow: hidden; }
.ac1 .img span { display: block; height: 100%; background: radial-gradient(circle at 70% 30%, #fde68a 0 18%, transparent 19%), linear-gradient(160deg, #e0e7ff, #c7d2fe); transition: transform .5s ease; }
.ac1 .b { padding: 14px 16px 16px; }
.ac1 .k { margin: 0; color: #6941c6; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ac1 h3 { margin: 4px 0; font-size: 17px; }
.ac1 .p { margin: 0; color: #344054; font-weight: 700; }
.ac1:hover, .ac1:focus-visible { transform: translateY(-4px); box-shadow: 0 18px 32px -14px rgba(16,24,40,.35); }
.ac1:hover .img span, .ac1:focus-visible .img span { transform: scale(1.06); }
.ac1:focus-visible { outline: 3px solid #7f56d9; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .ac1, .ac1 .img span { transition: none; } .ac1:hover, .ac1:focus-visible { transform: none; } .ac1:hover .img span { transform: none; } }

09. Details Slide Up on Hover

CardReveal

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>
.ac2 { position: relative; width: 260px; max-width: 100%; height: 300px; border-radius: 18px; overflow: hidden; font-family: Inter, system-ui, sans-serif; color: #fff; }
.ac2 .bg { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(2,6,23,.85)), linear-gradient(200deg, #0ea5e9, #1e3a8a 55%, #0f172a); }
.ac2 .panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; }
.ac2 h3 { margin: 0; font-size: 20px; }
.ac2 .more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .35s ease, opacity .35s ease; }
.ac2 .more > div { min-height: 0; overflow: hidden; }
.ac2 p { margin: 8px 0 10px; color: #dbeafe; font-size: 14px; line-height: 1.45; }
.ac2 a { color: #fff; font-weight: 700; font-size: 14px; }
.ac2:hover .more, .ac2:focus-within .more { grid-template-rows: 1fr; opacity: 1; }
.ac2 a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (hover: none) { .ac2 .more { grid-template-rows: 1fr; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ac2 .more { transition: none; } }

10. Staggered Entrance

CardEntrance

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.

View code
<ul class="ac3"><li style="--i:0"><b>2.4k</b><span>Orders</span></li><li style="--i:1"><b>98%</b><span>On time</span></li><li style="--i:2"><b>4.8</b><span>Rating</span></li></ul>
.ac3 { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0; padding: 0; list-style: none; font-family: Inter, system-ui, sans-serif; box-sizing: border-box; max-width: 100%; }
.ac3 li { display: grid; width: 92px; padding: 16px 12px; border: 1px solid #e4e7ec; border-radius: 14px; background: #fff; text-align: center; animation: ac3 .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 140ms); }
.ac3 b { color: #101828; font-size: 22px; }
.ac3 span { color: #475467; font-size: 13px; }
@keyframes ac3 { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) { .ac3 li { animation: none; } }

11. Cursor Spotlight Card

CardJavaScript

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>
.ac4 { --x: 50%; --y: 50%; position: relative; width: 280px; max-width: 100%; box-sizing: border-box; padding: 26px 22px; border: 1px solid #263048; border-radius: 18px; background: #111727; font-family: Inter, system-ui, sans-serif; overflow: hidden; }
.ac4::before { content: ""; position: absolute; inset: 0; background: radial-gradient(220px circle at var(--x) var(--y), rgba(56,189,248,.18), transparent 70%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.ac4:hover::before { opacity: 1; }
.ac4 h3 { position: relative; margin: 0 0 8px; color: #f1f5ff; font-size: 18px; }
.ac4 p { position: relative; margin: 0; color: #a8b3cf; font-size: 14px; line-height: 1.55; }
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.

View code
<details class="ac5"><summary><span><b>Team plan</b><small>$12 per seat / month</small></span><i aria-hidden="true"></i></summary><ul><li>Unlimited projects</li><li>Shared libraries</li><li>Priority support</li></ul></details>
.ac5 { width: 280px; max-width: 100%; box-sizing: border-box; border: 1px solid #d0d5dd; border-radius: 14px; background: #fff; font-family: Inter, system-ui, sans-serif; color: #101828; interpolate-size: allow-keywords; }
.ac5 summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; cursor: pointer; list-style: none; border-radius: 14px; }
.ac5 summary::-webkit-details-marker { display: none; }
.ac5 summary span { display: grid; } .ac5 small { color: #475467; font-size: 13px; }
.ac5 i { width: 10px; height: 10px; border-right: 2px solid #475467; border-bottom: 2px solid #475467; transform: rotate(45deg); transition: transform .25s; }
.ac5[open] i { transform: rotate(-135deg); }
.ac5::details-content { height: 0; overflow: hidden; transition: height .3s ease, content-visibility .3s allow-discrete; }
.ac5[open]::details-content { height: auto; }
.ac5 ul { margin: 0; padding: 0 18px 16px 36px; color: #344054; font-size: 14px; line-height: 1.8; }
.ac5 summary:focus-visible { outline: 3px solid #84adff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ac5::details-content, .ac5 i { transition: none; } }

13. Holographic Shine Card

CardGradient

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.

View code
<article class="ac6"><p class="t">Founder member</p><p class="n">#0042</p><p class="o">Ana Ribeiro</p></article>
.ac6 { position: relative; display: grid; align-content: space-between; width: 240px; max-width: 100%; box-sizing: border-box; aspect-ratio: 5 / 7; padding: 20px; border-radius: 18px; background: linear-gradient(150deg, #1e1b4b, #312e81 60%, #4c1d95); color: #fff; font-family: Inter, system-ui, sans-serif; overflow: hidden; }
.ac6::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,0,128,.35), rgba(0,255,255,.35), rgba(255,255,0,.3), transparent 70%) 0 0 / 250% 250%; mix-blend-mode: color-dodge; opacity: .35; transition: background-position .8s ease, opacity .3s; pointer-events: none; }
.ac6:hover::after { background-position: 100% 100%; opacity: .8; }
.ac6 p { position: relative; margin: 0; }
.ac6 .t { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #c7d2fe; }
.ac6 .n { font: 800 44px Inter, system-ui, sans-serif; }
.ac6 .o { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .ac6::after { transition: none; } }

14. Card That Reveals a Back Face

Card3D

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.

View code
<a class="ac7" href="#bread"><span class="back"><b>You need</b>500g flour · 10g salt · 7g yeast · 350ml water</span><span class="front"><b>Overnight loaf</b><small>Prep 20 min · Rise 12 h</small></span></a>
.ac7 { position: relative; display: block; width: 260px; max-width: 100%; height: 170px; perspective: 800px; font-family: Inter, system-ui, sans-serif; text-decoration: none; }
.ac7 span { position: absolute; inset: 0; display: grid; align-content: center; gap: 6px; padding: 18px; box-sizing: border-box; border-radius: 16px; }
.ac7 .back { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; font-size: 14px; line-height: 1.5; }
.ac7 .front { background: linear-gradient(135deg, #ea580c, #b45309); color: #fff; transform-origin: top; transition: transform .5s ease; backface-visibility: hidden; }
.ac7 .front b { font-size: 20px; } .ac7 small { color: #ffedd5; }
.ac7:hover .front, .ac7:focus-visible .front { transform: rotateX(-105deg); }
.ac7:focus-visible { outline: 3px solid #fb923c; outline-offset: 3px; border-radius: 16px; }
@media (prefers-reduced-motion: reduce) { .ac7 .front { transition: none; } .ac7:hover .front, .ac7:focus-visible .front { transform: none; opacity: 0; } }

15. Card That Tilts Toward the Pointer

3DJavaScript

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>
.tc1 { perspective: 700px; }
.tc1 .card { --rx: 0deg; --ry: 0deg; width: 250px; max-width: 100%; box-sizing: border-box; padding: 24px; border-radius: 20px; background: linear-gradient(145deg, #1e293b, #0f172a); border: 1px solid #334155; color: #e2e8f0; font-family: Inter, system-ui, sans-serif; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .4s ease; box-shadow: 0 30px 50px -30px #000; }
.tc1 .card.live { transition: transform .08s linear; }
.tc1 .k { margin: 0; color: #38bdf8; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.tc1 h3 { margin: 6px 0; color: #fff; font-size: 20px; } .tc1 p:last-child { margin: 0; color: #94a3b8; font-size: 14px; }
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>
.tc2 { position: relative; width: 250px; max-width: 100%; height: 170px; perspective: 600px; font-family: Inter, system-ui, sans-serif; }
.tc2 article { position: absolute; inset: 0; box-sizing: border-box; padding: 22px; border-radius: 18px; background: #fff; border: 1px solid #e4e7ec; box-shadow: 0 20px 40px -24px rgba(16,24,40,.45); transition: transform .3s ease; pointer-events: none; }
.tc2 h3 { margin: 0 0 6px; color: #101828; } .tc2 p { margin: 0; color: #475467; font-size: 14px; }
.tc2 .z { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); z-index: 2; }
.tc2:has(i:nth-child(1):hover) article { transform: rotateX(8deg) rotateY(-8deg); }
.tc2:has(i:nth-child(2):hover) article { transform: rotateX(8deg); }
.tc2:has(i:nth-child(3):hover) article { transform: rotateX(8deg) rotateY(8deg); }
.tc2:has(i:nth-child(4):hover) article { transform: rotateY(-8deg); }
.tc2:has(i:nth-child(6):hover) article { transform: rotateY(8deg); }
.tc2:has(i:nth-child(7):hover) article { transform: rotateX(-8deg) rotateY(-8deg); }
.tc2:has(i:nth-child(8):hover) article { transform: rotateX(-8deg); }
.tc2:has(i:nth-child(9):hover) article { transform: rotateX(-8deg) rotateY(8deg); }
@media (prefers-reduced-motion: reduce) { .tc2 article { transform: none !important; } }

17. Tilt with Moving Glare

3DLight

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>
.tc3 { perspective: 800px; }
.tc3 .card { --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 50%; position: relative; width: 250px; max-width: 100%; aspect-ratio: 16 / 10; box-sizing: border-box; padding: 22px; border-radius: 18px; background: linear-gradient(135deg, #4338ca, #9333ea); color: #fff; font-family: Inter, system-ui, sans-serif; overflow: hidden; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .3s ease; }
.tc3 .card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at var(--gx) var(--gy), rgba(255,255,255,.35), transparent 55%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.tc3 .card:hover::after { opacity: 1; }
.tc3 h3 { margin: 0 0 6px; font-size: 22px; } .tc3 p { margin: 0; color: #e9d5ff; }
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>
.tc4 { perspective: 800px; }
.tc4 .card { position: relative; width: 250px; max-width: 100%; height: 170px; box-sizing: border-box; padding: 24px; border-radius: 18px; background: linear-gradient(150deg, #fef3c7, #fde68a); transform-style: preserve-3d; transition: transform .45s ease; font-family: Inter, system-ui, sans-serif; }
.tc4 .card:hover { transform: rotateX(10deg) rotateY(-14deg); }
.tc4 h3 { margin: 30px 0 4px; color: #451a03; font-size: 22px; transform: translateZ(40px); }
.tc4 p { margin: 0; color: #78350f; transform: translateZ(20px); }
.tc4 .badge { position: absolute; top: 16px; right: 16px; padding: 4px 10px; border-radius: 999px; background: #b91c1c; color: #fff; font-weight: 800; font-size: 13px; transform: translateZ(60px); }
@media (prefers-reduced-motion: reduce) { .tc4 .card { transition: none; } .tc4 .card:hover { transform: none; } }

19. Payment Card with Tilt and Sheen

3DCard

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.

View code
<div class="tc5"><div class="cc" role="img" aria-label="Card ending 4821"><span class="chip"></span><span class="num">•••• 4821</span><span class="nm">A. MENDES</span></div></div>
.tc5 { perspective: 900px; }
.tc5 .cc { --rx: 0deg; --ry: 0deg; position: relative; display: grid; grid-template-rows: 1fr auto auto; width: 280px; max-width: 100%; aspect-ratio: 85.6 / 54; box-sizing: border-box; padding: 20px; border-radius: 16px; background: linear-gradient(125deg, #0f766e, #134e4a 60%, #042f2e); color: #ecfeff; font-family: "JetBrains Mono", ui-monospace, monospace; overflow: hidden; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease; box-shadow: 0 24px 40px -24px #000; }
.tc5 .cc::after { content: ""; position: absolute; inset: -50%; background: linear-gradient(115deg, transparent 45%, rgba(255,255,255,.18) 50%, transparent 55%); transform: translateX(calc(var(--ry) * 4)); pointer-events: none; }
.tc5 .chip { width: 38px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #fde68a, #ca8a04); }
.tc5 .num { font-size: 18px; letter-spacing: .12em; } .tc5 .nm { font-size: 12px; letter-spacing: .14em; opacity: .85; }
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.

View code
<ul class="tc6"><li><a href="#design">Design</a></li><li><a href="#build">Build</a></li><li><a href="#launch">Launch</a></li></ul>
.tc6 { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0; padding: 0; list-style: none; perspective: 600px; box-sizing: border-box; max-width: 100%; font-family: Inter, system-ui, sans-serif; }
.tc6 a { display: grid; place-items: center; width: 90px; height: 110px; border: 1px solid #d0d5dd; border-radius: 14px; background: #fff; color: #101828; font-weight: 800; text-decoration: none; transition: transform .3s ease, box-shadow .3s ease; }
.tc6 a:hover, .tc6 a:focus-visible { transform: rotateY(-14deg) rotateX(6deg) translateZ(10px); box-shadow: 10px 16px 24px -14px rgba(16,24,40,.45); }
.tc6 a:focus-visible { outline: 3px solid #528bff; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .tc6 a { transition: none; } .tc6 a:hover, .tc6 a:focus-visible { transform: none; } }

21. Floating Card with Ground Shadow

3DShadow

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>
.tc7 { display: grid; justify-items: center; gap: 22px; font-family: Inter, system-ui, sans-serif; }
.tc7 article { width: 230px; max-width: 100%; box-sizing: border-box; padding: 22px; border-radius: 18px; background: linear-gradient(160deg, #312e81, #1e1b4b); border: 1px solid #4338ca; color: #e0e7ff; animation: tc7 3.2s ease-in-out infinite; }
.tc7 h3 { margin: 0 0 6px; color: #fff; } .tc7 p { margin: 0; font-size: 14px; color: #c7d2fe; }
.tc7 .sh { width: 180px; height: 16px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.6), transparent); animation: tc7s 3.2s ease-in-out infinite; }
@keyframes tc7 { 50% { transform: translateY(-14px); } }
@keyframes tc7s { 50% { transform: scaleX(.75); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .tc7 article, .tc7 .sh { animation: none; } }

22. Fanned Card Stack

StackHover

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.

View code
<div class="sc1" tabindex="0" aria-label="Three colour themes: Ember, Violet, Lagoon"><div style="--r:-8deg;--c:#c2410c">Ember</div><div style="--r:0deg;--c:#6d28d9">Violet</div><div style="--r:8deg;--c:#0e7490">Lagoon</div></div>
.sc1 { position: relative; display: grid; width: 180px; height: 220px; font: 800 18px Inter, system-ui, sans-serif; }
.sc1 > div { grid-area: 1 / 1; display: grid; align-items: end; padding: 16px; border-radius: 16px; background: var(--c); color: #fff; transform-origin: 50% 110%; transform: rotate(var(--r)); box-shadow: 0 10px 30px -10px rgba(0,0,0,.6); transition: transform .35s ease; }
.sc1:hover > div, .sc1:focus-visible > div { transform: rotate(calc(var(--r) * 2.6)); }
.sc1:focus-visible { outline: 2px solid #fff; outline-offset: 10px; border-radius: 16px; }
@media (prefers-reduced-motion: reduce) { .sc1 > div { transition: none; } }

23. Swipe Deck with Next Button

StackJavaScript

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>
.sc2 { width: 260px; max-width: 100%; font-family: Inter, system-ui, sans-serif; }
.sc2 .deck { position: relative; height: 150px; isolation: isolate; }
.sc2 article { position: absolute; inset: 0; box-sizing: border-box; padding: 20px; border: 1px solid #e4e7ec; border-radius: 16px; background: #fff; color: #101828; font-weight: 700; line-height: 1.4; box-shadow: 0 6px 16px -10px rgba(16,24,40,.4); transition: transform .35s ease, opacity .35s ease; }
.sc2 article:nth-child(2) { transform: translateY(10px) scale(.95); z-index: -1; }
.sc2 article:nth-child(3) { transform: translateY(20px) scale(.9); z-index: -2; }
.sc2 article.out { transform: translateX(120%) rotate(12deg); opacity: 0; }
.sc2 .row { display: flex; align-items: center; justify-content: space-between; margin-top: 34px; }
.sc2 p { margin: 0; color: #475467; font-size: 13px; }
.sc2 button { padding: 9px 14px; border: 0; border-radius: 8px; background: #101828; color: #fff; font: 700 13px Inter, system-ui, sans-serif; cursor: pointer; }
.sc2 button:focus-visible { outline: 3px solid #84adff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sc2 article { transition: none; } }
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>
.sc3 { width: 270px; max-width: 100%; height: 300px; overflow-y: auto; padding: 8px; box-sizing: border-box; border-radius: 18px; background: #0b0f1a; font-family: Inter, system-ui, sans-serif; }
.sc3:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }
.sc3 article { position: sticky; top: calc(var(--i) * 14px); height: 170px; box-sizing: border-box; margin-bottom: 40px; padding: 18px; border-radius: 14px; background: var(--c); color: #fff; box-shadow: 0 -6px 18px -8px rgba(0,0,0,.6); }
.sc3 article:last-child { margin-bottom: 0; }
.sc3 h3 { margin: 0 0 6px; } .sc3 p { margin: 0; opacity: .9; font-size: 14px; }

25. Stack That Spreads into a Row

StackLayout

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.

View code
<ul class="sc4" tabindex="0" aria-label="Team members: AL, JP, SK, MR"><li style="--c:#fecaca">AL</li><li style="--c:#fde68a">JP</li><li style="--c:#bbf7d0">SK</li><li style="--c:#bfdbfe">MR</li></ul>
.sc4 { display: flex; margin: 0; padding: 8px; list-style: none; border-radius: 16px; font: 800 18px Inter, system-ui, sans-serif; }
.sc4 li { display: grid; place-items: center; width: 64px; height: 84px; border: 2px solid #fff; border-radius: 14px; background: var(--c); color: #1f2937; box-shadow: 0 6px 14px -8px rgba(0,0,0,.45); transition: margin .3s ease, transform .3s ease; }
.sc4 li + li { margin-left: -44px; }
.sc4 li:nth-child(odd) { transform: rotate(-4deg); } .sc4 li:nth-child(even) { transform: rotate(3deg); }
.sc4:hover li + li, .sc4:focus-visible li + li { margin-left: 8px; }
.sc4:hover li, .sc4:focus-visible li { transform: none; }
.sc4:focus-visible { outline: 3px solid #528bff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sc4 li { transition: none; } }

26. Stacked Notifications

StackNotifications

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>
.sc5 { width: 270px; max-width: 100%; font-family: Inter, system-ui, sans-serif; }
.sc5 button { margin-bottom: 10px; padding: 6px 10px; border: 1px solid #36406a; border-radius: 999px; background: #151b2e; color: #c7d2fe; font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
.sc5 button:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }
.sc5 ul { display: grid; margin: 0; padding: 0; list-style: none; isolation: isolate; }
.sc5 li { grid-area: 1 / 1; display: grid; gap: 2px; padding: 12px 14px; border: 1px solid #2c3554; border-radius: 14px; background: #1a2135; color: #9aa6c7; font-size: 13px; transition: transform .3s ease, opacity .3s ease; }
.sc5 li b { color: #fff; font-size: 14px; }
.sc5 li:nth-child(2) { transform: translateY(10px) scale(.94); opacity: .7; z-index: -1; }
.sc5 li:nth-child(3) { transform: translateY(20px) scale(.88); opacity: .45; z-index: -2; }
.sc5.open ul { gap: 8px; } .sc5.open li { grid-area: auto; transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sc5 li { transition: none; } }
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.

View code
<div class="sc6"><figure style="--r:-9deg;--x:-40px;--g:linear-gradient(135deg,#fbbf24,#ef4444)"><div></div><figcaption>Lisbon</figcaption></figure><figure style="--r:6deg;--x:40px;--g:linear-gradient(135deg,#34d399,#0ea5e9)"><div></div><figcaption>Azores</figcaption></figure><figure style="--r:-2deg;--x:0px;--g:linear-gradient(135deg,#a78bfa,#ec4899)"><div></div><figcaption>Porto</figcaption></figure></div>
.sc6 { position: relative; display: grid; place-items: center; width: 280px; max-width: 100%; height: 260px; }
.sc6 figure { grid-area: 1 / 1; width: 140px; margin: 0; padding: 10px 10px 8px; background: #fff; box-shadow: 0 10px 20px -10px rgba(0,0,0,.45); transform: translateX(var(--x)) rotate(var(--r)); transition: transform .3s ease; font: 600 13px "JetBrains Mono", ui-monospace, monospace; color: #344054; text-align: center; }
.sc6 figure div { aspect-ratio: 1; background: var(--g); }
.sc6 figcaption { margin-top: 6px; }
.sc6 figure:hover { z-index: 2; transform: translateX(var(--x)) rotate(0) scale(1.06); }
@media (prefers-reduced-motion: reduce) { .sc6 figure { transition: none; } }

28. Layered Pricing Highlight

StackPricing

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>
.sc7 { position: relative; isolation: isolate; width: 230px; max-width: 100%; box-sizing: border-box; padding: 22px; border-radius: 18px; background: #1e293b; border: 1px solid #334155; color: #cbd5e1; font-family: Inter, system-ui, sans-serif; }
.sc7::before, .sc7::after { content: ""; position: absolute; left: 12px; right: 12px; border-radius: 18px; z-index: -1; }
.sc7::before { bottom: -10px; height: 40px; background: #334155; }
.sc7::after { bottom: -20px; left: 24px; right: 24px; height: 40px; background: #263244; z-index: -2; }
.sc7 .tag { display: inline-block; margin: 0 0 10px; padding: 3px 9px; border-radius: 999px; background: #22d3ee; color: #083344; font-size: 12px; font-weight: 800; }
.sc7 h3 { margin: 0; color: #fff; font-size: 20px; }
.sc7 .pr { margin: 6px 0; } .sc7 .pr b { color: #fff; font-size: 30px; }
.sc7 .d { margin: 0; font-size: 14px; }

About these CSS Card Hover Effects

One link per card

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.