<div class="container">
<div class="image-wrapper">
<img src="https://i.postimg.cc/bJs0ZYPS/DSC-1027.jpg" alt="Sample Image">
</div>
</div>
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}
.image-wrapper {
width: 300px;
height: 300px;
overflow: hidden;
border-radius: 10px;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.4);
}
.image-wrapper img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease-in-out;
}
.image-wrapper:hover img {
transform: scale(1.2);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.