Flip Vertical

Image flips vertically on hover/focus via a 3D rotateX rotation.

Flip Vertical demo

Hover or focus the image to see the effect.

HTML

description

CSS

.hover-effect.flip-vertical img{
  transform: scale(1.25);
  transition: transform 0.5s ease;
}
.hover-effect.flip-vertical:hover img,
.hover-effect.flip-vertical:focus-visible img{
  transform: perspective(800px) scale(1.25) rotateX(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .hover-effect.flip-vertical img{
    transition: none;
  }
  .hover-effect.flip-vertical:hover img,
  .hover-effect.flip-vertical:focus-visible img{
    transform: perspective(800px) scale(1.25) rotateX(180deg);
  }
}

The animates transform: perspective(800px) scale(1.25) rotateX(180deg) for a 3D vertical flip. Select the code and copy with Ctrl+C or ⌘C.