-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMedia Query.html
More file actions
executable file
·52 lines (45 loc) · 1.28 KB
/
Media Query.html
File metadata and controls
executable file
·52 lines (45 loc) · 1.28 KB
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
<!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>Media Query examples</title>
<style>
.box {
color: white;
background-color: red;
font-size: 30px;
text-align: center;
display: none;
}
/* using media queries */
@media (max-width: 400px) {
#box1 {
display: block;
}
}
@media (min-width: 401px) and (max-width: 780px) {
#box2 {
display: block;
}
}
@media (min-width: 781px) and (max-width: 1200px) {
#box3 {
display: block;
}
}
@media (min-width: 1201px) {
#box4 {
display: block;
}
}
</style>
</head>
<body>
<div class="box" id="box1">This is an Android Phone screen</div>
<div class="box" id="box2">This is a Tablet screen</div>
<div class="box" id="box3">This is a Desktop computer screen</div>
<div class="box" id="box4">This is a Wide screen monitor screen</div>
</body>
</html>