Hover or focus the image to see the effect.
HTML
CSS
.hover-effect.tilt-right img{
transition: transform 0.5s ease;
}
.hover-effect.tilt-right:hover img,
.hover-effect.tilt-right:focus-visible img{
transform: scale(1.4) rotate(8deg);
}
@media (prefers-reduced-motion: reduce) {
.hover-effect.tilt-right img{
transition: none;
}
.hover-effect.tilt-right:hover img,
.hover-effect.tilt-right:focus-visible img{
transform: scale(1.4) rotate(8deg);
}
}
The animates transform: scale(1.4) rotate(8deg). The slight scale prevents blank corners as the image tilts. Select the code and copy with Ctrl+C or ⌘C.