Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

how to make background image responsive in css

/*width of image is auto adjusted by 70% of its container width.*/
img {
width: 70%;
}
/*if your image has a 50% width for any kind of screen. 
But when you want to make it full-size for mobile devices you need to get help from media queries:*/
/*using media Queries */
@media only screen and (max-width: 480px) {
img {
width: 100%;
}
}
 
PREVIOUS NEXT
Tagged: #background #image #responsive #css
ADD COMMENT
Topic
Name
8+3 =