max-width, max-height for IE6

Basically max-width, min-width, max-height and min-height are the properties of CSS 2 and are not supported by IE 6. It works well with IE 7 and mozilla firefox but not with IE 6 and lower versions of IE.

But i have found a solution for this and it goes as below:

eg: if you have one or more image to display such that there should be some restrictions of height and width of image. i.e. image should not be having width more than 500 (suppose) and height not more than 200, then the css for the image should be as given below:

img.thumb_100{

max-height:100px;

max-width:100px;

width:expression(document.body.clientWidth > 500? “500px”: “auto” );

height:expression(document.body.clientHeight > 200? “200px”: “auto” );

}

same way you can try for min-width and min-height.

Thanks,

Sachin (http://www.avidindiainc.com)

Advertisements

6 thoughts on “max-width, max-height for IE6

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s