-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathz_index.html
More file actions
120 lines (113 loc) · 3.22 KB
/
Copy pathz_index.html
File metadata and controls
120 lines (113 loc) · 3.22 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>z_index</title>
<style>
body{
background-color: #F2F3F4;
font-family: Arial, Helvetica, sans-serif;
}
div
{
position: absolute;
}
.c2
{
position: relative;
top: 150px;
width: 100%;
}
.container1
{
background-color: red;
width: 250px;
height: 120px;
}
.container2
{
background-color: green;
width: 400px;
height: 80px;
padding: 10px;
box-sizing: border-box;
}
.container3
{
background-color: red;
width: 250px;
height: 60px;
z-index: 2;
padding: 10px;
box-sizing: border-box;
}
.container4
{
background-color: green;
width: 300px;
height: 130px;
z-index: 1;
}
.c3
{
position: relative;
top: 320px;
width: 100%;
}
.container5
{
background-color: red;
width: 250px;
height: 160px;
z-index: 2;
padding: 10px;
box-sizing: border-box;
}
.container6
{
background-color: green;
width: 400px;
height: 200px;
padding: 10px;
z-index: 1;
}
.container55
{
background-color: grey;
width: 350px;
height: 130px;
padding: 10px;
z-index: 3;
}
.explanation
{
position: relative;
top: 280px;
padding-bottom: 25px;
}
</style>
</head>
<body>
<h1>z-index</h1>
<p>Case 1</p>
<div class="c1">
<div class="container1">Container 1</div>
<div class="container2">Container Green. <br>By its position on the html (down Container Red), <br> This contanier is up to Container Red </div>
</div>
<div class="c2">
<p>Case 2</p>
<div class="container3">Container Red. <br> z-index:2;</div>
<div class="container4"><br><br><br><br>Container Green. <br>z-index:1;</div>
</div>
<div class="c3">
<p>Case 3</p>
<div class="container5">Container Red. <br> z-index:2;</div>
<div class="container6">                Container Green. <br>                z-index:1;<br><br><br><br><br>
<div class="container55"><br><br><br>Container Grey. <br> z-index:3; <br> Son of Container Green</div>
</div>
<p class="explanation">On Case 3, Grey has z-index bigger (3) than Red(2), but Gray is a -div- inside of Green, so, never will have priority bigger than its father (Green)</p>
</div>
</body>
</html>