# 3D Flip Card

> A card that flips over in 3D on hover to reveal its back side.

- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: flip, 3d, rotate, hover, perspective
- Live preview: https://copy-css.com/snippets/flip-card
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="flip-card">
  <div class="flip-inner">
    <div class="flip-front">Hover to flip</div>
    <div class="flip-back">Surprise!</div>
  </div>
</div>
```

## CSS

```css
.flip-card {
  width: 190px;
  height: 120px;
  perspective: 800px;
  font: 700 18px/1 system-ui, sans-serif;
}

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

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

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip-front { background: #7c3aed; }

.flip-back {
  background: #db2777;
  transform: rotateY(180deg);
}
```

## Notes

- This CSS 3D Flip Card is 37 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, 3D transforms, transforms and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
