I have the following code which sets up a container which has a height that changes with the width when the browser is re-sized (to maintain a square aspect ratio).
Try
Html
CSS
.img-container { position: absolute; top: 0; left: 0; height:0; padding-bottom:100%; } .img-container img { width:100%; }