21 CSS Button Hover Effects

3D Flip

The button flips on its X axis to reveal a second face — pure CSS 3D transform perspective.

Pure CSS MIT licensed

3D Flip the 9th of 21 designs in the 21 CSS Button Hover Effects collection. The design is implemented in pure CSS — no JavaScript required. Copy the HTML and CSS panels below into your project. Because the demo is pure CSS, it works in any framework or templating engine you happen to use. The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.

Live preview

Open in playground

The code

<div class="bhe-09__wrapper">
  <button class="bhe-09__btn">
    <span class="bhe-09__front">Hover Me</span>
    <span class="bhe-09__back">Flipped!</span>
  </button>
</div>
.bhe-09__wrapper {
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  background: transparent;
  color: inherit;
}

.bhe-09__wrapper {
  perspective: 600px;
  display: inline-block;
}
.bhe-09__btn {
  position: relative;
  display: block;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  background: transparent;
  border: none;
}
.bhe-09__front,
.bhe-09__back {
  display: block;
  padding: 12px 32px;
  border-radius: 8px;
  backface-visibility: hidden;
}
.bhe-09__front {
  background: #ff6c8a;
  color: #fff;
}
.bhe-09__back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #7c6cff;
  color: #fff;
  transform: rotateX(180deg);
}
.bhe-09__wrapper:hover .bhe-09__btn {
  transform: rotateX(180deg);
}

Search CodeFronts

Loading…