media query min and max width css code example
Example 1: media query min and max
@media only screen and (max-width: 600px) {...}
@media only screen and (min-width: 600px) {...}
@media only screen and (max-width: 600px) and (min-width: 400px) {...}
Example 2: min and max width media query
@media (max-width: 989px) and (min-width: 768px) {}
Example 3: minimum width of different devices in html
body {
background: white;
}
@media screen and (min-width: 980px) {
body {
background: red;
}
}
@media screen and (max-width: 979px) {
body {
background: blue;
}
}
@media screen and (max-width: 500px) {
body {
background: green;
}
}