Skip to content

Commit bbb1f7e

Browse files
committed
Code 2 - Class 4
1 parent 7d3f057 commit bbb1f7e

3 files changed

Lines changed: 83 additions & 0 deletions

File tree

456 KB
Loading
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
box-sizing: border-box;
5+
}
6+
7+
section {
8+
width: 100%;
9+
height: 100vh;
10+
display: flex;
11+
justify-content: center;
12+
align-items: center;
13+
position: relative;
14+
}
15+
16+
section:nth-child(1) {
17+
background-color: rgb(183, 183, 183);
18+
}
19+
section:nth-child(2) {
20+
background-color: rgb(0, 213, 255)
21+
}
22+
section:nth-child(3) {
23+
background-color: rgb(255, 0, 204);
24+
}
25+
section div {
26+
width: 100px;
27+
height: 100px;
28+
}
29+
30+
section div.box-red {
31+
background-color: rgb(255, 0, 0);
32+
position: absolute;
33+
top: 10px;
34+
left: 40%;
35+
z-index: 2;
36+
}
37+
38+
section div.box-yellow {
39+
background-color: yellow;
40+
position: absolute;
41+
z-index: 1;
42+
left: 35%;
43+
top: 15px;
44+
}
45+
46+
section div.box-green {
47+
background-color: green;
48+
position: absolute;
49+
left: 30%;
50+
top: 20px;
51+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0"
8+
/>
9+
<link
10+
rel="stylesheet"
11+
href="css/style.css"
12+
/>
13+
<title>Document</title>
14+
</head>
15+
<body>
16+
<section>
17+
<div class="box-red"></div>
18+
<div class="box-yellow"></div>
19+
<div class="box-green"></div>
20+
</section>
21+
<section>
22+
<div class="box-red"></div>
23+
<div class="box-yellow"></div>
24+
<div class="box-green"></div>
25+
</section>
26+
<section>
27+
<div class="box-red"></div>
28+
<div class="box-yellow"></div>
29+
<div class="box-green"></div>
30+
</section>
31+
</body>
32+
</html>

0 commit comments

Comments
 (0)