Horizontal Skew

Image skews horizontally on hover/focus, with a small zoom to keep the viewport covered.

Horizontal Skew demo

Hover or focus the image to see the effect.

HTML

description

CSS

.hover-effect.skew-horizontal img{
  transition: transform 0.5s ease;
}
.hover-effect.skew-horizontal:hover img,
.hover-effect.skew-horizontal:focus-visible img{
  transform: scale(1.4) skewX(15deg);
}
@media (prefers-reduced-motion: reduce) {
  .hover-effect.skew-horizontal img{
    transition: none;
  }
  .hover-effect.skew-horizontal:hover img,
  .hover-effect.skew-horizontal:focus-visible img{
    transform: scale(1.4) skewX(15deg);
  }
}

The animates transform: scale(1.4) skewX(15deg). The slight scale prevents blank corners as the image skews. Select the code and copy with Ctrl+C or ⌘C.