-
Notifications
You must be signed in to change notification settings - Fork 1
/
media queries in css.html
72 lines (50 loc) · 1.32 KB
/
media queries in css.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MEDIA QUERIES IN CSS</title>
</head>
<style>
.container {
border: 2px solid rgb(23, 24, 23);
}
@media only screen and (max-width: 500px) {
#box1 {
border: 2px solid skyblue;
background-color: lawngreen;
}
}
@media only screen and (min-width: 500px) and (max-width: 799px) {
#box2 {
border: 2px solid tomato;
background-color: lightcyan;
}
}
@media only screen and (min-width: 800px) and (max-width: 1100px) {
#box3 {
border: 2px solid fuchsia;
background-color: rgb(230, 217, 217);
}
}
@media only screen and (min-width: 1100px) {
#box4 {
border: 2px solid khaki;
background-color: blue;
}
}
.box {
font-size: 20px;
}
</style>
<body>
<header class="container">
<ul>
<li class="box" id="box1">I AM IPHONE</li>
<li class="box" id="box2">I AM MOBILE</li>
<li class="box" id="box3">I AM TABLET</li>
<li class="box" id="box4">I AM COMPUTER/LAPTOP</li>
</ul>
</header>
</body>
</html>