Answers for "css media query width and height"

CSS
51

media query

@media only screen and (max-width: 600px) {
  body {
    background-color: lightblue;
  }
}
Posted by: Guest on December-06-2019
1

how to set media query for both width and height in css

@media (min-height: 768px) and (max-height: 768px) and (min-width: 1366px) and (max-width: 1366px) { ... }
Posted by: Guest on July-11-2021
1

hegith specific css in media query

/* Exact height */
@media (height: 360px) {
  div {
    color: red;
  }
}

/* Minimum height */
@media (min-height: 25rem) {
  div {
    background: yellow;
  }
}

/* Maximum height */
@media (max-height: 40rem) {
  div {
    border: 2px solid blue;
  }
}
Posted by: Guest on June-22-2020

Code answers related to "css media query width and height"

Browse Popular Code Answers by Language