/
index.html
68 lines (67 loc) · 1.5 KB
/
index.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
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
<style>
.box1 {
position: static; /* No need to write because it's bydefault */
background-color: #ff6263;
}
.box2 {
position: absolute;
background-color: #1b98f5;
left: 200px;
top: 120px;
}
.box3 {
background-color: #38cc77;
position: relative;
left: 115px;
}
.box4 {
background-color: #f7cd2e;
position: fixed;
right: 30px;
bottom: 0;
}
.box5 {
background-color: #6a1b4d;
position: sticky;
top: 10px;
left: 600px;
}
/* no related to topic */
.container {
border: 3px solid black;
height: 650px;
background-color: #758283;
padding: 20px;
margin: 20px;
position: relative;
}
p {
border: 3px solid black;
height: 100px;
width: 100px;
text-align: center;
border-radius: 7px;
display: inline-block;
color: rgb(255, 255, 255);
padding: 10px;
font-size: x-large;
}
body {
height: 2000px;
}
</style>
</head>
<body>
<div class="container">
<p class="box1">Box 1: I'm Static</p>
<p class="box2">Box 2: I'm absolute</p>
<p class="box3">Box 3: I'm relative</p>
<p class="box4">Box 4: I'm fixed</p>
<p class="box5">Box 5: I'm sticky</p>
</div>
</body>
</html>