# Flashcard Flip Card

> A study flashcard that flips vertically on click or tap, driven by a hidden checkbox so it works on touch.

- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: flashcard, flip, click, tap, checkbox, quiz, study
- Live preview: https://copy-css.com/snippets/flashcard-flip-card
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<label class="flashcard">
  <input type="checkbox" aria-label="Flip card to show the answer">
  <span class="flashcard-inner">
    <span class="flashcard-face">
      <small>Question</small>
      What does CSS stand for?
    </span>
    <span class="flashcard-face flashcard-back">
      <small>Answer</small>
      Cascading Style Sheets
    </span>
  </span>
</label>
```

## CSS

```css
.flashcard {
  display: block;
  width: 240px;
  height: 140px;
  font-family: system-ui, sans-serif;
  perspective: 800px;
  cursor: pointer;
}

.flashcard input {
  position: absolute;
  opacity: 0;
}

.flashcard-inner {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 16px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.flashcard input:checked + .flashcard-inner {
  transform: rotateX(180deg);
}

.flashcard input:focus-visible + .flashcard-inner {
  outline: 3px solid #0891b2;
  outline-offset: 4px;
}

.flashcard-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 16px;
  border-radius: inherit;
  background: #fff;
  box-shadow: 0 10px 24px -10px rgba(8, 145, 178, 0.45);
  color: #164e63;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flashcard-face small {
  color: #0891b2;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.flashcard-back {
  background: #0891b2;
  color: #fff;
  transform: rotateX(180deg);
}

.flashcard-back small {
  color: #cffafe;
}

@media (prefers-reduced-motion: reduce) {
  .flashcard-inner {
    transition: none;
  }
}
```

## Notes

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