-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
62 lines (58 loc) · 1.43 KB
/
Copy pathindex.html
File metadata and controls
62 lines (58 loc) · 1.43 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
.static-box {
position: static;
background-color: lightblue;
width: 100px;
height: 100px;
}
.relative-box {
position: relative;
background-color: lightgreen;
width: 100px;
height: 100px;
top: 20px;
left: 20px;
}
.absolute-box {
position: absolute;
background-color: coral;
width: 100px;
height: 100px;
top: 20px;
left: 10px;
}
.fixed-box {
position: fixed;
background-color: yellow;
width: 100px;
height: 100px;
bottom: 8%;
right: 5%;
}
.sticky-box {
position: sticky;
background-color: pink;
width: 100px;
height: 100px;
top: 10px;
}
</style>
</head>
<body>
<div style="height: 250vh">
<div class="static-box">Static</div>
<div class="relative-box">Relative</div>
<!-- <div style="position: relative;border: 1px solid red;width: 300;top:10%;"> -->
<div class="absolute-box">Absolute</div>
<!-- </div> -->
<div class="fixed-box">Fixed</div>
<div class="sticky-box">Sticky</div>
<p>Scroll down to see the sticky element in action.</p>
</div>
</body>
</html>