-
Notifications
You must be signed in to change notification settings - Fork 0
/
vh-units.html
70 lines (61 loc) · 1.49 KB
/
vh-units.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
69
70
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=0.5">
<style>
html {
height: 100%;
width: 100%;
}
body {
height: 2000px;
width: 200%;
margin: 0px;
padding: 0px;
}
div.bar {
width: 20px;
top: 0px;
}
.fixedpercent {
position: fixed;
height: 99%;
background-color: lightsteelblue;
}
.fixedvh {
position: fixed;
height: 99vh;
background-color: lightskyblue;
}
.abspercent {
position: absolute;
height: 99%;
background-color: darksalmon;
}
.absvh {
position:absolute;
height: 99vh;
background-color: coral;
}
.textfixed {
width: 600px;
height: 20px;
padding: 0px 20px;
transform: rotate(90deg);
transform-origin: left bottom 0;
}
.textabs {
width: 600px;
height: 20px;
padding: 0px 120px;
transform: rotate(90deg);
transform-origin: left bottom 0;
}
</style>
</head>
<body>
<div style="right: 0px" class="bar fixedpercent"><div class="textfixed">percentage-based position:fixed</div></div>
<div style="right: 25px" class="bar fixedvh"><div class="textfixed">viewport-unit position:fixed; 99vh</div></div>
<div style="right: 50px" class="bar abspercent"><div class="textabs">percentage-based position:absolute</div></div>
<div style="right: 75px" class="bar absvh"><div class="textabs">viewport-unit position:absolute; 99vh</div></div>
</body></html>