Previous Message
Next Message

max-width in I.E.

Sent by Les Mizzell on 17 December 2004 15:03

>>I need to limit the width of images in a gallery. Of course, the below
>>works in almost everything *except* I.E.

> For ie you can use expressions:
> #img.test_img {width:expression(if(this.clientWidth>300)this.width=300);}

Here's what seems to finally work:

..test_img {
max-width: 320px;
width:expression(this.width > 320 ? "320px" : this.width);

I've only tested in the most current Netscape, I.E. and Firefox and it's 
working there. Haven't tried it on Safari or any older browsers yet...


Les Mizzell

css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: