title: max-width and max-height for scaling images in Internet Explorer
body: <p>I'm in the process of creating a gallery which displays several formats of images (wide, square and tall) in a fixed space.  The ideal solution would be to have all the images to be the same dimensions, but this cannot be achieved.</p>
  
  <p>I'm using a combination of max-width and max-height to ensure that images scale properly to the limited space.  The only problem with this is Internet Explorer, which displays images at the max-width and max-height widths and heights (because of it's inability to understand them).</p>
  
  <p>I've been looking at various solutions to this problem, but haven't managed to make any of them work (yet).  The gallery uses jQuery and Galleriffic, which work fine except for the max-width/max-height issue.</p>
  
  <p>Any suggestions?</p>
  
  <p><strong>Edit:</strong>  It seems that the problem lies in the way Internet Explorer handles max-height and max-width with images, in that they don't scale correctly.</p>
  
  <p><strong>Edit 2:</strong>  I've done a bit of testing and the problem with IE isn't max-width and max-height, which are working (in that they're making sure the image doesn't become larger than what it's set to), for example:</p>
  
  <p><code>max-width: 600px;
  max-height: 600px;</code></p>
  
  <p>will make sure that the image does not become larger than those two values. The images are not scaling properly, so tall images will appear squashed and wide images will appear stretched. I switched on IE7 Compatibility view and the images displayed correctly, but in IE8, the appear squashed/stretched (which means it'll be a problem with IE8)..</p>