Get tips on XML - (X)html - CSS and php

CSS tricks for IE

home

Another CSS2 property not supported by IE

When dealing with text everyone will know of the hack from Svend Tofte, but for images it isn't sufficient.

The way around it is very easy. Add the following in your stylesheet after your max-width and max-height values, change 300 to the maximum value you want.

width: expression(this.width > 300 ? 300: auto);
height: expression(this.height > 300 ? 300: auto);

See it in action.
Scroll over the thumbs:

max-width   max-width   max-width

See what happens when the hack isn't used.

Valid XHTML 1.1