Using The width Property
If the width
property is set to a percentage and the height
property is set to “auto”, the image will be responsive and scale up and down:
Example
img {
width: 100%;
height: auto;
}
If the width
property is set to a percentage and the height
property is set to “auto”, the image will be responsive and scale up and down:
img {
width: 100%;
height: auto;
}