Image hover effect animation HTML is created with Bootstrap and custom CSS. See image zoom on hover, we can use it on any card design where we are using a post or page preview image as a thumbnail. CSS image hover effects will help make your project more beautiful.
HTML
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="mt-4 text-center">Images Hover Effects</h2>
<p class="mb-5 text-center">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>
</div>
</div>
<div class="row">
<div class="col-sm-6 col-sm-6 col-lg-4">
<div class="img-box">
<img src="images/image-one.jpg" alt="">
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="img-box">
<img src="images/image-two.jpg" alt="">
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="img-box">
<img src="images/image-three.jpg" alt="">
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="img-box">
<img src="images/image-four.jpg" alt="">
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="img-box">
<img src="images/image-five.jpg" alt="">
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="img-box">
<img src="images/image-six.jpg" alt="">
</div>
</div>
</div>
</div>
CSS
h2 {
position: relative;
margin-bottom: 35px;
}
h2::after {
content: "";
width: 120px;
height: 3px;
display: inline-block;
background: #FFC107;
position: absolute;
left: 0px;
right: 0px;
bottom: -20px;
margin: 0 auto;
}
p{
width: 70%;
margin: 0 auto;
color: #848484;
}
/*-- Images Hover Effects CSS --*/
.img-box {
position: relative;
transition: .5s;
max-height: 230px;
overflow: hidden;
margin-bottom: 30px;
border-radius: 0px 100px;
}
.img-box img {
max-width: 100%;
border: 3px solid #FFC107;
position: relative;
width: 100%;
}
.img-box::before {
content: '';
border-left: 3px solid #ffffff;
border-top: 3px solid #ffffff;
position: absolute;
left: 20px;
top: 20px;
width: 50px;
height: 50px;
z-index: 1;
transition: .5s;
}
.img-box::after {
content: '';
border-right: 3px solid #ffffff;
border-bottom: 3px solid #ffffff;
position: absolute;
right: 20px;
bottom: 20px;
width: 50px;
height: 50px;
z-index: 2;
transition: .5s;
}
.img-box:hover {
transform: scale(1.04);
}
.img-box:hover::before {
left: 10px;
top: 10px;
}
.img-box:hover::after {
right: 10px;
bottom: 10px;
}