-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathposition.html
More file actions
70 lines (60 loc) · 1.03 KB
/
position.html
File metadata and controls
70 lines (60 loc) · 1.03 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Position</title>
<style>
/* static | absolute | */
div {
width: 300px;
height: 150px;
border: 1px solid blue;
position: static;
}
.relative {
position: relative;
left: 30px;
top: 20px
}
.absolute {
position: absolute;
left: 10px;
top: 5px;
}
.fixed {
position: fixed;
right: 10px;
bottom: 0px;
width: 100px;
}
.sticky {
position: sticky;
bottom: 2px;
}
</style>
</head>
<body>
<h1>Position Static</h1>
<div class="static">
Static
</div>
<h1>Position Relative</h1>
<div class="relative">
Relative
</div>
<h1>Position Absolute</h1>
<div style="position: relative; border: 1px solid red">
<div class="absolute">
Absolute
</div>
</div>
<h1>Position Sticky</h1>
<div class="sticky">
Sticky
</div>
<h1>Position Fixed</h1>
<div class="fixed">
Fixed
</div>
</body>
</html>