-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmediaquery_task2.html
37 lines (35 loc) · 1.17 KB
/
mediaquery_task2.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
<head>
<meta name="viewport" content="width=device-width", initial-scale=1.0>
<style>
body{
background-color: yellow;
}
div{
background-color: lavender;
}
/* @media only screen and (orientation:landscape){ */
@media only screen and (max-width:600px){
div{
background-color: lightgreen;
}
}
@media only screen and (max-width:400px){
div{
background-color: lightblue;
}
}
/* div{
/* height:75px;
width: 100%;
background-color: lavender;
color: #000;
text-align: center;
} */
</style>
<body>
<div>
<h1>Resize the browser window to see the effect!</h1>
<p>Use mediaqueries to set the background-color to lavender if the viewport is 800 pixels wide or wider, to lightgreen if the viewport is between 400 and 799 pixels wide. If the viewport is smaller than 400 pixels, the background-color is lightblue.</p>
</div>
</body>
</head>