Answers for "media queries in css"

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
14

css media query

/* BOOSTRAP MEDIA BREAKPOINTS */
/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {  
  .selector {
  	background-color:#f00;
  }
}
/* Medium devices (tablets, 768px and up) The navbar toggle appears at this breakpoint */
@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-16-2020
1

css different sreen size

/* For Mobile */
@media screen and (max-width: 540px) {
    .view {
        width: 400px;
    }
}

/* For Tablets */
@media screen and (min-width: 540px) and (max-width: 780px) {
    .view {
        width: 600px;
    }
}
Posted by: Guest on August-07-2020
1

minimum width of different devices in html

body {
  background: white;    
}

@media screen and (min-width: 980px) /* Desktop */ {
  body {
    background: red;
  }
}

@media screen  and (max-width: 979px) /* Tablet */ {
  body {
    background: blue;
  }
}

@media screen and (max-width: 500px) /* Mobile */ {
  body {
    background: green;
  }
}
Posted by: Guest on April-30-2020
0

media query in css

/*Any Mobile Device*/
@media only screen and (max-width: 767px) { }
 /*Tablets Device*/
@media only screen and (max-width: 991px) { }
 /*ipad Pro  Device*/
@media only screen and (max-width: 1024px) { }
 /*large  Device*/
@media only screen and (max-width: 1200px) { }
Posted by: Guest on October-19-2021

Browse Popular Code Answers by Language