media queries max width 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;
}
}
Example 4: media query
@media (max-height : 800px){
p{
font-size:10px
}
}
Example 5: what is a max and min width media query
@media only screen and (max-width: 600px) {...}
@media only screen and (min-width: 600px) {...}