Card flip

A card flip turns an element over in 3D to show its back, like turning a playing card, using rotateY, perspective and backface-visibility.

A card flip rotates a card half a turn around its vertical (or horizontal) axis so its back face comes into view: a credit card turning to show its security code, a flash card turning to show the answer, a boarding pass turning to its back.

In CSS it takes three pieces: perspective on the parent so the turn has depth, transform-style: preserve-3d on the card so its faces live in 3D, and backface-visibility: hidden on both faces, with the back already rotated 180 degrees. Flipping is then a transform: rotateY(180deg) on the card, which animates smoothly.

Make the hidden side unreachable while it is turned away (inert, or aria-hidden plus no focusable children), give the trigger a clear label, and fall back to a cross-fade under reduced motion.

.scene { perspective: 900px; }
.card { position: relative; transform-style: preserve-3d; transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.card.is-flipped { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; }
.back { transform: rotateY(180deg); }

See it live

Related terms