To resize the image proportionally using CSS:
img.resize {
width:540px; /* you can use % */
height: auto;
}
Control size and maintain proportion :
#your-img {
height: auto;
width: auto;
max-width: 300px;
max-height: 300px;
}