Weird one... if you specify max-width of 100% on an image and display inline-block on its container, combined with a width attribute in the markup, IE8 does not show the image.
Here is a pen: http://codepen.io/iamkeir/pen/MYadRO
(View in full page on IE8: http://codepen.io/iamkeir/full/MYadRO)
<div class="problem">
<img src="http://placehold.it/320x240" width="240" />
</div>
<style type="text/css">
div {
display: inline-block;
}
img {
max-width: 100%;
}
</style>
It can be fixed by making the container display inline instead of inline-block just for IE8, or specifying a width of 100% and max-width instead of width attribute... but this is not as handy as specifying widths in markup.
Two questions:
1) Is there a better/alternative fix?
2) Any idea what is actually going on? (I know, I know, "because IE8".)
NOTE: It seems whilst http://caniuse.com/#search=inline-block implies IE8 supports inline-block (), there is a known issue reported in the footer. Should probably be marked as partial support instead:
http://blog.caplin.com/2013/06/07/developing-for-ie8-inline-block-resize-bug/