Answers for "how to set media query"

CSS
120

css media queries

@media only screen and (max-width: 1200px){
    /*Tablets [601px -> 1200px]*/
}
@media only screen and (max-width: 600px){
	/*Big smartphones [426px -> 600px]*/
}
@media only screen and (max-width: 425px){
	/*Small smartphones [325px -> 425px]*/
}
Posted by: Guest on July-04-2020
51

media query

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

media query

// Example media query syntax
@media only screen and (min-width: 768px) {
  .my-example-class {
    padding: 50px;
  }
}

// Best Practice
// keep default style for smallest screen size (portrait mobile, below 576px)
// and then proceed in assending order with media query like below

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }

// so on ...
Posted by: Guest on September-02-2020
-3

media query

@media only screen and (max-width: 800px) {
  body {
    background-color: ; /*your color*/
  }
}
Posted by: Guest on November-04-2020
0

media query css

/* These classes can be added to HTML Elements
   * to affect visibility on certain displays.
   */
  .hide-on-small-only
  .hide-on-small-and-down
  .hide-on-med-and-down
  .hide-on-med-and-up
  .hide-on-med-only
  .hide-on-large-only
  .show-on-large
  .show-on-medium
  .show-on-small
  .show-on-medium-and-up
  .show-on-medium-and-down
Posted by: Guest on June-27-2021

Browse Popular Code Answers by Language