What browser dimensions will meet the media query below? code example
Example 1: minimum width of different devices in html
body {
background: white;
}
@media screen and (min-width: 980px) /* Desktop */ {
body {
background: red;
}
}
@media screen and (max-width: 979px) /* Tablet */ {
body {
background: blue;
}
}
@media screen and (max-width: 500px) /* Mobile */ {
body {
background: green;
}
}
Example 2: minimum width of different devices in html
<meta name="viewport" content="width=device-width,initial-scale=1">
Example 3: media query methods
1. @media print
{
p
{
font-family: georgia,montserrat;
}
}
2. <link rel="stylesheet" media="screen"
href="/css/screen_version.css">
3. @import "screenstyles.css" screen;