-
Notifications
You must be signed in to change notification settings - Fork 0
/
media-queries.html
91 lines (88 loc) · 1.83 KB
/
media-queries.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
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
background-color: gray;
}
h1 {
display: none;
}
/* phone */
@media (max-width: 575px) {
.phone h1 {
display: block;
}
}
/* landscape */
@media (min-width: 576px) and (max-width: 767px) {
body {
background-color: green;
}
.landscape h1 {
display: block;
}
}
/* tablets */
@media (min-width: 768px) and (max-width: 991px) {
body {
background-color: red;
}
.tablets h1 {
display: block;
}
}
/* desktop */
@media (min-width: 992px) and (max-width: 1199px) {
body {
background-color: yellow;
}
.desktop h1 {
display: block;
}
}
/* large-desktop */
@media (min-width: 1200px) and (max-width: 1399px) {
body {
background-color: orange;
}
.large h1 {
display: block;
}
}
/* xlarge-desktop */
@media (min-width: 1400px) {
body {
background-color: pink;
}
.xlarge h1 {
display: block;
}
}
</style>
</head>
<body>
<div class="phone">
<h1>phone</h1>
</div>
<div class="landscape">
<h1>landscape</h1>
</div>
<div class="tablets">
<h1>tablets</h1>
</div>
<div class="desktop">
<h1>desktop</h1>
</div>
<div class="large">
<h1>large</h1>
</div>
<div class="xlarge">
<h1>xlarge</h1>
</div>
</body>
</html>