max-width for images in IE

 

max-width for images in IE

To use max-width the syntax is:

selector {max-width:value;}

Internet Explorer up to version 6 doesn’t support the max-width property but has the ability to perform javascript like functions on it’s CSS so you can fake max-width with it. Here’s the syntax:

selector {width: expression(this.width > value ? value: true);}

example for IMG html tag:

img {
max-width:390px;
/* IE Image max-width */
width: expression(this.width > 390 ? 390: true);
}

NOTE: max-width property does NOTHING for the file size if used with an image.


3 Responses to “max-width for images in IE”

  1. great!

  2. thanks, I’ve been searching for a straight forward method and this works perfectly.

  3. Yay! Thanks.

Post a Comment



Entertainment Directory of Entertainment Blogs Blog Directory Scouter for YouTube Widescreen, in format de 16/9 ; Facts and Myths about Power Supply - PC ; American Music Awards 2008 - The Winners Today.com Entertainment Blogs
TopOfBlogs blog search directory Add to Technorati Favorites Blogverzeichnis - Blog Verzeichnis bloggerei.de Entertainment blogs Bloggers and Blogging Blogs - BlogCatalog Blog Directory Entertainment Blogs - Blog Top Sites
Blog DigNow.org The House Of Blogs, directorio de blogs BlogESfera Directorio de Blogs Hispanos - Agrega tu Blog BlogRankers.com Blog Directory & Search engine directorio web blogarama - the blog directory
blog directory PodNova Listed in LS Blogs the Blog Directory and Blog Search Engine