image css responsive code example
Example 1: responsive img
.responsive-img {
max-width:100%;
display:block;
height:auto;
}
Example 2: responsive images
<img src="img.png" style="max-width:100%;height:auto;">
Example 3: 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);
}
}