โœฆ StealThis .dev

Flip Card 3D

A CSS 3D flip card that reveals a back face on hover. Built with CSS perspective, transform-style preserve-3d, and backface-visibility. Zero JavaScript.

Open in Lab
css perspective transform-style backface-visibility
Targets: HTML

Code

Flip Card 3D

A pure CSS 3D flip card with a front and back face. Hover (or focus) triggers a smooth rotateY(180deg) that reveals the back face โ€” no JavaScript needed.

How it works

Three CSS properties work together:

  1. perspective: 1000px on the container โ€” creates the 3D depth
  2. transform-style: preserve-3d on the card โ€” keeps children in 3D space
  3. backface-visibility: hidden on both faces โ€” hides the back of each face when rotated

On hover, the card flips with transform: rotateY(180deg). The back face starts pre-rotated at rotateY(180deg), so it appears correct after the flip.

Variants

  • Vertical flip โ€” change rotateY to rotateX
  • Click to flip โ€” add a JS toggle class instead of :hover
  • Different sizes โ€” controlled by width/height on .card

When to use it

  • Team member cards (name / bio)
  • Product cards (image / details)
  • Flashcards / quiz UI