Safari Image Size Auto Height CSS

css

Solution

Just set only the width on the image. The browser will scale the image proportionally automatically.

.userImg { width: 100%; }
.imgContainer { height: auto; width: 150px; }​

Problem

I am testing this problem in the latest version of Safari for Windows 7. The problem is that this code works in all other browsers BUT safari: ``` <style type="text/css"> .userImg { height: 100%; width: 100%; } .imgContainer { height: auto; width: 150px; } </style> <div class="imgContainer"> <img id="img" class="userImg" src="TemplateFiles/Hydrangeas.jpg" alt="" /> </div> ``` Does anyone know of a trick to get this to size the image proportionally in Safari using just CSS? Thanks!

Original source