media query max width and height code example
Example 1: media query
@media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}
Example 2: min and max width media query
@media (max-width: 989px) and (min-width: 768px) {}
Example 3: hegith specific css in media query
@media (height: 360px) {
div {
color: red;
}
}
@media (min-height: 25rem) {
div {
background: yellow;
}
}
@media (max-height: 40rem) {
div {
border: 2px solid blue;
}
}
Example 4: what is a max and min width media query
@media only screen and (max-width: 600px) {...}
@media only screen and (min-width: 600px) {...}