<html>
<head lang="en">
<meta charset="UTF-8">
<title>Hover effect</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-6 col-sm-6">
<div class="box">
<img src="https://images.pexels.com/photos/569093/pexels-photo-569093.jpeg?w=940&h=650&auto=compress&cs=tinysrgb" alt="image_hover" />
<div class="box-content">
<h3>Hover me</h3>
<p>This is a very beautiful hover effect in pure css</p>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="box hover">
<img src="https://images.pexels.com/photos/569093/pexels-photo-569093.jpeg?w=940&h=650&auto=compress&cs=tinysrgb" alt="image_hover" />
<div class="box-content">
<h3>Hover me</h3>
<p>This is a very beautiful hover effect in pure css</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
body {
margin-top: 100px !important;
}
.box {
color: #fff;
font-size: 16px;
overflow: hidden;
position: relative;
text-align: right;
transition: all 0.45s ease;
transition: all 0.45s ease;
}
.box img {
width: 100%;
height: 100%;
}
.box:before,
.box:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: #F40076;
opacity: 0.5;
transition: all 0.45s ease;
transition: all 0.45s ease;
}
.box:before {
transform: skew(30deg) translateX(80%);
transform: skew(30deg) translateX(80%);
}
.box:after {
transform: skew(-30deg) translateX(70%);
transform: skew(-30deg) translateX(70%);
}
.box:hover:before,
.box.hover:before {
transform: skew(30deg) translateX(30%);
transform: skew(30deg) translateX(30%);
transition-delay: 0.05s;
transition-delay: 0.05s;
}
.box:hover:after,
.box.hover:after {
transform: skew(-30deg) translateX(20%);
transform: skew(-30deg) translateX(20%);
}
.box .box-content {
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
z-index: 1;
bottom: 0;
padding: 20px 20px 20px 40%;
}
.box .box-content:before,
.box .box-content:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: #F40076;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
opacity: 0.5;
z-index: -1;
transition: all 0.45s ease;
transition: all 0.45s ease;
}
.box .box-content:before {
transform: skew(30deg) translateX(100%);
transform: skew(30deg) translateX(100%);
}
.box .box-content:after {
transform: skew(-30deg) translateX(90%);
transform: skew(-30deg) translateX(90%);
}
.box:hover .box-content:before,
.box.hover .box-content:before {
transform: skew(30deg) translateX(50%);
transform: skew(30deg) translateX(50%);
transition-delay: 0.15s;
transition-delay: 0.15s;
}
.box:hover .box-content:after,
.box.hover .box-content:after {
transform: skew(-30deg) translateX(40%);
transform: skew(-30deg) translateX(40%);
transition-delay: 0.1s;
transition-delay: 0.1s;
}
.box h3,
.box p {
margin: 0;
opacity: 0;
letter-spacing: 1px;
}
.box h3 {
font-size: 30px;
font-weight: 700;
margin-bottom: 10px;
text-transform: uppercase;
}
.box p {
font-size: 15px;
}
.box:hover h3,
.box.hover h3,
.box:hover p,
.box.hover p {
transform: translateY(0);
transform: translateY(0);
opacity: 0.9;
}
@media screen and (max-width: 990px){
.box{
margin-bottom: 30px;
}
}
@media screen and (max-width:768px){
.box h3{
font-size:20px;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.