CSS Skeleton Card
A card-shaped placeholder with an image, title and text lines, swept by a single shine layer.
<div class="skel-card" role="status" aria-label="Loading content">
<div class="skel-card-media"></div>
<div class="skel-card-line skel-card-title"></div>
<div class="skel-card-line"></div>
<div class="skel-card-line skel-card-short"></div>
</div>
.skel-card {
position: relative;
display: grid;
gap: 8px;
width: min(100%, 220px);
padding: 12px;
overflow: hidden;
border-radius: 16px;
background: #fff;
box-shadow: 0 2px 10px #0f172a12;
}
.skel-card-media {
aspect-ratio: 2 / 1;
border-radius: 10px;
background: #e5e7eb;
}
.skel-card-line {
height: 12px;
border-radius: 6px;
background: #e5e7eb;
}
.skel-card-title {
width: 70%;
height: 16px;
margin-top: 4px;
}
.skel-card-short {
width: 45%;
}
/* One shine layer sweeps across the whole card */
.skel-card::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(100deg, #fff0 20%, #ffffffb3 50%, #fff0 80%);
transform: translateX(-100%);
animation: skel-card-sweep 1.6s ease-in-out infinite;
}
@keyframes skel-card-sweep {
to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
.skel-card::after { animation: none; }
}
About this CSS Skeleton Card
This CSS Skeleton Card is 51 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, linear gradients and box shadows. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#fff#0f172a12#e5e7eb#fff0#ffffffb3
How to use this skeleton card
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.skel-cardclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.