-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut8.htm
More file actions
46 lines (43 loc) · 1018 Bytes
/
tut8.htm
File metadata and controls
46 lines (43 loc) · 1018 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Visibility And Z index</title>
<style>
.box{
width: 170px;
height: 170px;
border: 2px solid red;
}
#box1{
background-color: rgb(12, 247, 12);
position: relative;
top: 49px;
z-index: 50;
}
#box2{
/* visibility: hidden; will hide the element but will show its space */
/* display: none; will hide the element and the space */
background-color: yellow;
/* z index will work only with position: relative absolute and fixed sticky */
position: relative;
top: 14px;
z-index: -1;
}
#box3{
background-color: rgb(230, 19, 166);
}
#box4{
background-color: rgb(89, 20, 201);
}
</style>
</head>
<body>
<!-- here $ is used to add no. in series -->
<div class="box" id="box1"></div>
<div class="box" id="box2"></div>
<div class="box" id="box3"></div>
<div class="box" id="box4"></div>
</body>
</html>