Gallery · 01 of 33

Zoom Hover

Simple scale on hover

HTML · CSS · No dependencies · MIT

HTML

<div class="zoom-hover">
  <img src="https://picsum.photos/id/10/800/600" alt="Nature">
</div>

CSS

.zoom-hover {
  width: 400px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
}

.zoom-hover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.zoom-hover:hover img {
  transform: scale(1.1);
}