johnnyg24 0 Posted March 7, 2013 Report Share Posted March 7, 2013 I am having trouble getting the height of an image to re-size in proportion to its width when the screen gets re-sized. I would like to only use CSS. I've looked around the internet and nothing I am finding is helping. Here is my CSS as of now #banner img{max-width:100% !important;width:900px;height:auto;} The width will re-size the but the height won't. This is only a problem in IE8 (which is 20% of all our site traffic). Can anyone help? Thank you, Quote Link to post Share on other sites
newseed 26 Posted March 25, 2013 Report Share Posted March 25, 2013 You don't have to use height: auto. However, if you have inlined styles within your image tag then you will need to remove them so that the css will work. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.