Answers for "ow to make image smaller depending on screen size"

CSS
0

how to change image based on screen size

@media screen and (max-width: 767px){   
    #main-img{      
        content:url("img/mobile_homepage.jpg");
    } 
}

@media screen and (min-width: 768px) {      
    #main-img{      
       content:url("img/tablet_homepage.jpg");
     } 
} 
@media (min-width: 992px){      
      #main-img{        
          content:url("img/desktop_homepage.jpg");  
      } 
}
@media (min-width: 1200px) {    
     #main-img{         
         content:url("img/desktop_homepage.jpg");   
     } 
}
Posted by: Guest on March-16-2022
-1

make image scale based on screen size

background-size: cover
Posted by: Guest on April-08-2020

Code answers related to "ow to make image smaller depending on screen size"

Browse Popular Code Answers by Language