3D Push

Image pushes back into 3D space on hover/focus via negative translateZ, producing a "pushed into the page" feel.

3D Push demo

Hover or focus the image to see the effect.

HTML

description

CSS

.hover-effect.push-3d img{
  transition: transform 0.5s ease;
}
.hover-effect.push-3d:hover img,
.hover-effect.push-3d:focus-visible img{
  transform: perspective(800px) translateZ(-50px) scale(1.1);
}
@media (prefers-reduced-motion: reduce) {
  .hover-effect.push-3d img{
    transition: none;
  }
  .hover-effect.push-3d:hover img,
  .hover-effect.push-3d:focus-visible img{
    transform: perspective(800px) translateZ(-50px) scale(1.1);
  }
}

The animates transform: perspective(800px) translateZ(-50px) scale(1.1) for a 3D push-back feel. Select the code and copy with Ctrl+C or ⌘C.