-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimage-overlay.html
More file actions
56 lines (52 loc) · 1.3 KB
/
image-overlay.html
File metadata and controls
56 lines (52 loc) · 1.3 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.container {
position: relative;
width: 25%;
margin: auto;
}
.image {
display: block;
width: 100%;
height: auto;
}
.overlay {
position: absolute;
top:0;
bottom:0;
left:0;
right:0;
height: 100%;
width: 100%;
opacity: 0;
transition: .3s ease-in-out;
background-color: #DB5461;
}
.container:hover .overlay {
opacity: 0.75;
}
.text {
color:white;
font-size: 30px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<img src="wdd130/personal/images/block-question.jpg" class="image" >
<div class="overlay">
<div class="text">Questions?</div>
</div>
</div>
</body>
</html>