-
Notifications
You must be signed in to change notification settings - Fork 0
/
tutorial-16.html
62 lines (61 loc) · 1.63 KB
/
tutorial-16.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
<!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 and Size Units</title>
<style>
.container{
border: 2px solid darkolivegreen;
background-color: rgb(215, 201, 182);
height: 450px;
text-align: center;
display: block;
}
/* #first{
font-size: 3em;
}
#second{
font-size: 2rem;
}
#third{
font-size: 2fr;
} */
@media only screen and (max-width:300px){
.container{
display: block;
font-size: 0.55rem;
}
}
@media (min-width:300px) and (max-width:500px){
.container{
display: block;
background-color: blue;
font-size: 0.75rem;
}
}
@media (max-width:800px) and (min-width:500px){
.container{
display: block;
background-color: aquamarine;
font-size: 1em;
}
}
@media (min-width:800px){
.container{
display: block;
background-color: greenyellow;
font-size: 2em;
}
}
</style>
</head>
<body>
<div class="container">
<h1 id="first">This is first heading</h1>
<h1 id="second">This is second heading</h1>
<h1 id="third">This is third heading</h1>
</div>
</body>
</html>