OK, I'm tinkering with an image gallery script and want my images to have max width of 875px and a max height of 800px, this is easy in FF (with max-height & max-width) and other real browsers but IE does not see these tags, so I'm currently using the following 'hack' to set the max width in IE to 875px;
.ima {
max-width:875px;
width:expression(this.width > 874 ? "875px":"auto");
}
Works fine, however when I also set up max height like this;
.ima {
max-width:875px;
width:expression(this.width > 874 ? "875px":"auto");
max-height:800px;
height:expression(this.height > 799 ? "800px":"auto");
}
Some images (ones which are both wider than 875 and heigher than 800) become distorted as both of the scripts come into effect and squash the image to 875x800 unlike the behaviour i want which is to have one or the other, am I missing something obvious? Anyone know another 'hack'?
.ima {
max-width:875px;
width:expression(this.width > 874 ? "875px":"auto");
}
Works fine, however when I also set up max height like this;
.ima {
max-width:875px;
width:expression(this.width > 874 ? "875px":"auto");
max-height:800px;
height:expression(this.height > 799 ? "800px":"auto");
}
Some images (ones which are both wider than 875 and heigher than 800) become distorted as both of the scripts come into effect and squash the image to 875x800 unlike the behaviour i want which is to have one or the other, am I missing something obvious? Anyone know another 'hack'?