-
Notifications
You must be signed in to change notification settings - Fork 0
/
ex07.html
57 lines (50 loc) · 1.12 KB
/
ex07.html
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 http-equiv="X-UA-Compatible" content="ie=edge" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Ex sobreposição espaços com z-index</title>
</head>
<style>
.wrapper {
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-auto-rows: 200px;
grid-gap: 10px;
}
.wrapper > div:nth-child(1) {
grid-row: 1/3;
grid-column: 1/3;
z-index: 2;
}
.wrapper > div:nth-child(2) {
grid-row: 2/4;
grid-column: 2/4;
z-index: 1;
}
.wrapper > div:nth-child(3) {
grid-row: 3/5;
grid-column: 3/5;
}
.wrapper > div:nth-child(4) {
grid-row: 4/6;
grid-column: 4/6;
}
.wrapper > div {
background-color: royalblue;
padding: 1rem;
}
.wrapper > div:nth-child(even) {
background-color: skyblue;
}
</style>
<body>
<div class="wrapper">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
</body>
</html>