Search
 
SCRIPT & CODE EXAMPLE
 

CSS

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");   
     } 
}
Comment

make image scale based on screen size

background-size: cover
Comment

PREVIOUS NEXT
Code Example
Css :: how to get element details using cssselector using beautifulsoup 
Css :: mettre image in the background 
Css :: css dropdown menu with scrollbar 
Css :: rgb purple color 
Css :: how to add background image in a container css 
Css :: bootstrap breakpoints 
Css :: how to change button gradient 
Css :: css make background visible in text 
Css :: Timeout for a fetch 
Css :: how to make div possion top in css 
Css :: hide scrollbar of a div but keep functionality 
Css :: use css to replace icon with text when hover 
Css :: warning: LF will be replaced by CRLF in Design/css/bootstrap.min.css. 
Css :: materialize css for react 
Css :: image responsive css 
Css :: how to install tailwind css in html 
Css :: css list items next to each other 
Css :: scrollbar css 
Css :: how to create multicolor text in css 
Css :: CSS Image Reflection 
Css :: css button pressed effect 
Css :: add arrow in select css 
Css :: css grid 1 row 2 columns 
Css :: terminal check time 
Css :: css nth-child 
Css :: background image repeat css 
Css :: icon borders css 
Css :: css remove whitespace around element 
Css :: inline pseudo element 
Css :: font shorthand 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =