← All Examples

3D Card Flip

A card that flips on hover using CSS 3D transforms and perspective.

Published May 19, 2026

Demo

🎨 Front Side
Hover to flip
✨ Back Side
Pure CSS
Card Two
Hover me
No JS needed!

HTML

<div class="flip-card">
  <div class="flip-inner">
    <div class="flip-front">Front</div>
    <div class="flip-back">Back</div>
  </div>
</div>

CSS

.flip-card {
  width: 200px;
  height: 130px;
  perspective: 800px;
}

.flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .55s ease;
}

.flip-card:hover .flip-inner {
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
}

.flip-back {
  transform: rotateY(180deg);
}

How it works

The container sets perspective to create the 3D space. The inner element holds both faces and uses transform-style:preserve-3d so children exist in the same 3D plane. The back face is pre-rotated 180deg and both faces have backface-visibility:hidden so the correct face shows at each point of the flip.