Html – Resize image proportionally with CSS?

csshtmlimage resizing

Is there a way to resize (scale down) images proportionally using ONLY CSS?

I'm doing the JavaScript way, but just trying to see if this is possible with CSS.

Best Answer

To resize the image proportionally using CSS:

img.resize {
    width:540px; /* you can use % */
    height: auto;
}