"Image Overlay Hover Effects With CSS3"
Bootstrap 4.0.0 Snippet by Divscodebd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<body>
<div class="center">
<div class="imagebox">
<img src="http://www.divscode.com/bootimg/pexel.jpeg" alt="">
<div class="main-content">
<div class="content">
<h1>Why do we use it?</h1>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using ,</p>
</div>
</div>
</div>
</div>
</body>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
body{
margin: 0px;
padding: 0px;
background: #262626;
}
.center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.imagebox{
position: relative;
width:500px;
height: 300px;
background-size: cover;
border:2px solid #fff;
overflow: hidden;
}
.imagebox img{
width: 100%;
transition: .5s;
}
.main-content{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
transition: .5s;
}
.main-content:before{
content: "";
position: absolute;
top: 0;
left: 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: