Do you use MIN/MAX-WIDTH and MIN/MAX-HEIGHT

neluni's picture

They have: 2 posts

Joined: Apr 2009

Title is wrong , correct one should be :
Do you use MIN/MAX-WIDTH and MIN/MAX-HEIGHT ??

I am building a liquid layout with percentage and wonder if I have to use MIN/MAX-WIDTH and MIN/MAX-HEIGHT , knowing that IE 6 and earlier versions do not support it.
Do you use them ?
Is there any rule available to avoid the bug ?

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

There are workarounds for achieving the same solution in IE6. Here is one example from this page:

#content {
width: expression(document.body.clientWidth < 742? "740px" : document.body.clientWidth > 1202? "1200px" : "auto");
min-width: 740px;
max-width: 1200px;
}

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

This article suggests that css expressions for IE adversely affect performance and the necessary control can be better implemented with "real" JavaScript.

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

I rarely use min and max width.

I generally build for the display chosen by the designer, and check to make sure the site is viewable/usable in 1024x768. I do not bother with smaller resolutions.

That covers about 96% of the viewers, the others are probably used to dealing with it.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

If I'm doing a flexible layout (and there are cases where this is the best solution). I'll definitely use min- and max-width. This helps to prevent the layout from completely falling apart if the screen width gets too wide or too narrow.

It's a good balance between accommodating user preferences and maintaining some design control.

He has: 629 posts

Joined: May 2007

To answer your question, yes. I use min- and max-width on all my pages. The script pr0gr4mm3r refers to is about the only way to get it to work in IE 6, although I don't bother as it is dying a slow and painful death.

Screen size is a bit of a red herring, though. By no means everyone uses "full screen" windows, and I don't even know how to get full screen on my Mac. You really have no idea of what window size your visitors use.

Mobile devices are getting popular, too. While mobile use for Internet is small, it is growing at a rate of 34% p.a. in Europe. I also see several people every day using iPhones for surfing here in California. So I think you are on the right lines, as Megan indicates.

BTW - It's not a bug in IE 6 - it is just one of many things lacking. Heck, it does not even support all of HTML.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.