Monday, 7 March 2011

IE8 bug - image max-width and table cells

In a very recent post I described a way to limit image sizes using max-width and max-height. Unfortunately a problem developed with this in IE8 when the images were being displayed in a table. The images would resize correctly, but the table cell wouldn't.

A work-around for the bug was quickly found...
img.myImage { max-width: 100px; max-height: 100px; }
div.imageWrapper { width: 110px;  }
<div class="imageWrapper">
     <img src="images/blah.jpg" class="myImage" />

  </div>
...thanks to my esteemed front-end colleagues and this post from Jon Jungman.

1 comment:

Comments are moderated, so you'll have to wait a little bit before they appear!