-
Notifications
You must be signed in to change notification settings - Fork 0
/
CSS position.html
66 lines (61 loc) · 1.56 KB
/
CSS position.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Position </title>
<style>
*{
margin: 0;
padding: 0;
}
.box1{
background-color: aqua;
/* position: sticky;
top: 0px;
height: 111px;
width: 100%;
margin: 0;
padding: 0; */
position: absolute;
top: 0px ;
left: 3px;
}
.box2{
background-color: green;
}
.box3{
background-color: black;
/* position: fixed;
bottom: 0px;
left: 8vw;
height: 111px; */
}
.box4{
background-color: brown;
}
.box{
height: 133px;
width: 80vw;
padding: 3px;
margin: 3px;
border: 2px solid blue;
}
.parent{
/* Exception: transform, filter, or perspective properties can also make an element appear as positioned */
padding: 43px;
margin: 32px;
border: 3px solid black;
/* position: sticky; */
}
</style>
</head>
<body>
<div class="parent">
<div class="box box1"></div>
<div class="box box2"></div>
<div class="box box3"></div>
<div class="box box4"></div>
</div>
</body>
</html>