-
Notifications
You must be signed in to change notification settings - Fork 0
/
HTML Relative and Absolute Positioning.html
79 lines (76 loc) · 2.68 KB
/
HTML Relative and Absolute Positioning.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
71
72
73
74
75
76
77
78
79
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Background</title>
<style>
*{
box-sizing:border-box;
margin: 0;
padding: 0;
}
#h1{
margin-bottom: 15px;
}
div#container {
background-color:purple;
position: relative;
top: 60px;
}
p {
width: 50px;
height: 50px;
border: 1px solid black;
margin-bottom: 15px;
}
#p1 {
background-color: #A52A2A;
width: 300px;
height: 300px;
}
#p2 {
background-color: green;
position: relative;
top: 65px;
left: 65px;
}
#p3 {
background-color: #5f9ea0
}
/********Large Devices Only*******************/
@media (min-width:1200px) {
#p1 {
width: 80%;
}
#p2 {
width: 150px;
height: 150px;
}
}
/********Medium Devices Only*******************/
@media (min-width: 992px) and (max-width: 1199px) {
#p1 {
width: 50%;
}
#p2 {
width: 100px;
height: 100px;
}
body { background: grey;}
}
</style>
<body>
<h1>Media Queries</h1>
<div>
<!--Page Positioning-->
<p id="p1"></p>
<!--Relative Positioning-->
<p id="p2"></p>
<!---->
<p id="p3"></p>
<p id="p4"></p>
<section> This is under regular content continuing after the paragraph boxes. </section>
</div>
</body>
</head>
</html>