Answers for "media query"

47

media query

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

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

// Extra small devices (portrait phones, less than 576px)
// No media query for `xs` since this is the default in Bootstrap

// 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) { ... }

// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
Posted by: Guest on May-18-2021
4

media query

@media only screen and (min-device-width: 900px) and (max-device-width: 1200px) {
  /* insert styles here */
}
Posted by: Guest on August-03-2021
4

media query

/* Smartphones and larger (mobile-first) */

/* Tablet portrait and larger */
@media only screen and (min-width: 600px) {}
/* Tablet landscape and larger */
@media only screen and (min-width: 900px) {}
/* Desktop and larger */
@media only screen and (min-width: 1200px) {}
/* Big desktop (4k) */
@media only screen and (min-width: 2500px) {}
Posted by: Guest on June-07-2021
4

media query

@media only screen and (max-width: 600px) {
  .class {
    // Your CSS
  }
}
Posted by: Guest on February-20-2020
-3

media query

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

media query

@media screen and (min-width:480px) and (max-width:800px) {
    /* Target landscape smartphones, portrait tablets, narrow desktops
    */
  }

  @media screen and (max-width:479px) {
    /* Target portrait smartphones */
  }
  
  @media all and (orientation: landscape) {
    /* Target device in landscape mode */
  }
  @media all and (orientation: portrait) {
    /* Target device in portrait mode */
  }
 /*https://developers.google.com/search/blog/2012/04/responsive-design-harnessing-power-of*/
Posted by: Guest on June-19-2021
-3

media query

@media (max-height : 800px){ /* from 0 to 800 px max height applies */
  p{
    font-size:10px
  }
}
Posted by: Guest on May-22-2020
-4

media query

@media only screen and (max-width: 600px) {
  body {
    // Change size, placement of elements
  }
}
Posted by: Guest on January-18-2021

Browse Popular Code Answers by Language