Answers for "responsive image using media query"

-4

media query

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

responsive image using media query

.img {
  background-image: url(examples/images/image-384.jpg); 
}
@media 
  (-webkit-min-device-pixel-ratio: 2), 
  (min-resolution: 192dpi) { 
  .img {
    background-image: url(examples/images/image-768.jpg);
  }
}
Posted by: Guest on February-02-2021
0

responsive image using media query

.img {
  background-image: url(examples/images/image-384.jpg);
  background-image: 
    -webkit-image-set(
      url(examples/images/image-384.jpg) 1x,
      url(examples/images/image-768.jpg) 2x,
    );
  background-image: 
    image-set(
      url(examples/images/image-384.jpg) 1x,
      url(examples/images/image-768.jpg) 2x,
    );
}
Posted by: Guest on February-02-2021
0

min-width media query

Max Media Query
Posted by: Guest on April-10-2020

Code answers related to "responsive image using media query"

Browse Popular Code Answers by Language