johnnyg24 Posted March 7, 2013 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, Link to comment Share on other sites More sharing options...
newseed Posted March 25, 2013 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now