Fade Out

Image fades out from fully opaque to fully transparent on hover.

Fade Out demo

Hover or focus the image to see the effect.

HTML

<div class="hover-effect fade-out">
  <img src="image.jpg" alt="description">
</div>

CSS

.hover-effect.fade-out img{
  transition: opacity 0.45s ease;
}
.hover-effect.fade-out:hover img,
.hover-effect.fade-out:focus-visible img{
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .hover-effect.fade-out img{
    transition: none;
  }
  .hover-effect.fade-out:hover img,
  .hover-effect.fade-out:focus-visible img{
    opacity: 0;
  }
}

Select the code and copy with Ctrl+C or ⌘C.