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.

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