<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Card Design Effect</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="box">
<div class="content">
<div>
<h2>Image Hover Effects</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Aspernatur, voluptatem rem fugiat unde quia commodi corporis. Esse atque vel alias dolorem maxime ipsam eius reprehenderit omnis vero, praesentium sapiente neque.</p>
<a href="#">Read More</a>
</div>
</div>
<img src="https://picsum.photos/id/10/200/300" alt="">
</div>
<div class="box">
<div class="content">
<div>
<h2>Image Hover Effects</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Aspernatur, voluptatem rem fugiat unde quia commodi corporis. Esse atque vel alias dolorem maxime ipsam eius reprehenderit omnis vero, praesentium sapiente neque.</p>
<a href="#">Read More</a>
</div>
</div>
<img src="https://picsum.photos/id/50/200/300" alt="">
</div>
<div class="box">
<div class="content">
<div>
<h2>Image Hover Effects</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Aspernatur, voluptatem rem fugiat unde quia commodi corporis. Esse atque vel alias dolorem maxime ipsam eius reprehenderit omnis vero, praesentium sapiente neque.</p>
<a href="#">Read More</a>
</div>
</div>
<img src="https://picsum.photos/id/70/200/300" alt="">
</div>
</body>
</html>
@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');
body{
margin: 0;
padding: 0;
font-family: 'Poppins', sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
flex-wrap: wrap;
}
.box {
position: relative;
width: 300px;
height: 300px;
background: #000;
margin:20px auto;
padding: 10px;
}
.content{
position: absolute;
top:0;
left:0;
right: 0;
bottom:0;
display: grid;
align-items: center;
color:#fff;
padding: 20px;
font-family: consolas;
text-align: center;
}
.content a {
display: block;
margin-top: 10px;
padding: 10px 20px;
border:1px solid #fff;
text-decoration: none ;
color:#fff;
transition: 0.5s;
}
.box img {
position: absolute;
top:0;
left:0;
width: 100%;
height: 100%;
object-fit: cover;
clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
transition: 1s;
}
.box:hover img {
clip-path: polygon(0 0, 100% 0, 0 0, 0% 100%);
}
@media (max-width:991px) {
.box {
margin:20px auto;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.