media query mobile view 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 for mobile landscape only

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

Example 3: media queries

@media all and (max-width: 699px) and (min-width: 520px) {
   ul li a {
    padding-left: 21px;
    background: url(../images/email.png) left center no-repeat;
  }
}

Tags:

Html Example