landscape mobile media query code example

Example 1: media query for mobile view css

@media only screen and (max-width: 600px) {
  body {
    background-color: lightblue;
  }
}

Example 2: media query css for all devices

@media (min-width: 600px) and (max-width: 800px) {

/* your css code here  */

/* html { background: red; } */


}

Example 3: mediaquery for portrate

@media (orientation: portrait) {
  body {
    flex-direction: column;
  }
}

Example 4: media query for mobile landscape only

@media screen and (orientation:landscape) and
(min-device-width: 320px) and (max-device-width: 450px) {
   /* Input Styles */
}

Tags:

Misc Example