Flip Horizontal

Image flips horizontally on hover/focus via a 3D rotateY rotation.

Flip Horizontal demo

Hover or focus the image to see the effect.

HTML

description

CSS

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

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