-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tut23.html
57 lines (47 loc) · 1.33 KB
/
Tut23.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Media query</title>
<style>
.box {
background-color: sienna;
color: silver;
text-align: center;
display: none;
font-size: 55px;
}
@media (max-width: 300px) {
#box1 {
display: block;
background-color: rgb(94, 3, 3);
}
}
@media (min-width: 301px) and (max-width: 500px) {
#box2 {
display: block;
background-color: rgb(207, 145, 28);
}
}
@media (min-width: 500px) and (max-width: 800px) {
#box3 {
display: block;
background-color: rgb(155, 21, 137);
}
}
@media (min-width: 800px) {
#box4 {
display: block;
background-color: rgb(57, 144, 214);
}
}
</style>
</head>
<body>
<div class="box" id="box1">I am A IPHONE</div>
<div class="box" id="box2">I am A TABLET</div>
<div class="box" id="box3">I am A Desktop Computer</div>
<div class="box" id="box4">I am A Widescreen Computer</div>
</body>
</html>