/
week-6-2-activity.html
61 lines (45 loc) · 1.35 KB
/
week-6-2-activity.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style type="text/css">
.sibling-element {
padding: 10px;
background-color: #f2f2f2;
}
.parent-element {
height: 800px;
padding: 10px;
background-color: #81adc8;
}
.main-element {
/*position: relative;*/
/*starts from original position*/
/*position: absolute;*/
/*starts with the same position as its parents but if the parents doesnt have position it will use the top left of the page as its sstarting point*/
/*position: static;*/
/*doesnt like the element move*/
position: fixed;
right: 0;
bottom: 0;
background-color: yellow;
padding: 10px;
}
</style>
</head>
<body>
<div class="parent-element">
<div class="sibling-element">
I'm the other sibling element.
</div>
<div class="main-element">
All eyes on me. I am the main element.
</div>
<div class="sibling-element">
I'm the other sibling element.
</div>
</div>
</body>
</html>