How to resize a image proportionally with CSS

To resize a image proportionally with CSS, simply set either width or height to auto. This should also work if the img html tag has width and height attributes set.

img.resize{
    width:200px;
    height: auto;
}

Please Share us:
Please rate this snippet

5 thoughts on “How to resize a image proportionally with CSS

Leave a Reply