Max-width on images and inline-block in IE


I'm trying to make an image fit a container, with a wrapping div that fits to the width of the image. I can do this succesfully, but when I set the max-width of the image to 100% (to make sure it fits into containing div) it doesn't work in IE9/IE8 (image is displayed at full width). Works fine in Chrome. Max width works when wrapper div isn't set to inline-block. I tried with floating the two elements as well, that didn't work either.

Here's the fiddle:


IE is quite often the odd one out :D

Try giving the image an absolute width value, like I did here.

By : Bluefire

This video can help you solving your question :)
By: admin