Clip Path Hover Effects
<!DOCTYPE html>
<html>
<head>
<title>Box</title>
</head>
<body>
<!-- https://bennettfeely.com/clippy/ -->
<div class="box">
<div class="content">
<div>
<h2>Image hover Effects</h2>
<p>It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<a href="#">Read More</a>
</div>
</div>
<img src="full-img.jpg">
</div>
</div>
<style type="text/css">
body{
margin: 0px;
padding: 0px;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.box{position: relative; width: 400px; height: 400px; background: #000;}
.content{position: absolute; top:0px; left: 0px; right: 0px; bottom: 0px; display: grid; align-items: center; color: #fff; padding: 20px; font-family: arial; text-align: center;}
.content a{
display: inline-block;
margin-top: 10px;
padding: 10px 20px;
text-decoration: none;
border: 1px solid#fff;
color: #fff;
transition: 0.5s;
}
.content a:hover{
color: #000;
background: #fff;
}
.box img{width: 100%; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; object-fit: cover; -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%); transition: 1s;}
.box:hover img{
-webkit-clip-path: polygon(0 0, 100% 0, 0 1%, 0% 100%);
clip-path: polygon(0 0, 100% 0, 0 1%, 0% 100%);
}
</style>
</body>
</html>
<html>
<head>
<title>Box</title>
</head>
<body>
<!-- https://bennettfeely.com/clippy/ -->
<div class="box">
<div class="content">
<div>
<h2>Image hover Effects</h2>
<p>It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<a href="#">Read More</a>
</div>
</div>
<img src="full-img.jpg">
</div>
</div>
<style type="text/css">
body{
margin: 0px;
padding: 0px;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.box{position: relative; width: 400px; height: 400px; background: #000;}
.content{position: absolute; top:0px; left: 0px; right: 0px; bottom: 0px; display: grid; align-items: center; color: #fff; padding: 20px; font-family: arial; text-align: center;}
.content a{
display: inline-block;
margin-top: 10px;
padding: 10px 20px;
text-decoration: none;
border: 1px solid#fff;
color: #fff;
transition: 0.5s;
}
.content a:hover{
color: #000;
background: #fff;
}
.box img{width: 100%; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; object-fit: cover; -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%); transition: 1s;}
.box:hover img{
-webkit-clip-path: polygon(0 0, 100% 0, 0 1%, 0% 100%);
clip-path: polygon(0 0, 100% 0, 0 1%, 0% 100%);
}
</style>
</body>
</html>
Comments
Post a Comment