Javascript expression in css to allow for min/max widths. replaces the min-width, max-width that works for IE6.
#content { height: 75px; background-color: #000; color: #fff; width: expression(document.body.clientWidth < 742? "740px" : document.body.clientWidth > 1202? "1200px" : "auto"); min-width: 740px; max-width: 1200px; }
Comments
Subscribe to comments
You need to login to post a comment.

This is actually cited as being bad for performance in High Performance Web Sites (YSlow dev group).
I have used this before, and yes it's slow, but when the design depends on min/max-width it does the trick.
You really should use IE conditional comments to limit the use of the expression() function to IE6 and earlier. IE7 and IE8 both support min-max width. I don't believe CSS validators will validate expression() also. Here is a reference to the use of expression to emulate min/max dimensions in CSS: max-width-and-min-width-support-for-ie
I added a pure CSS based min-width example for IE6 http://snipplr.com/view/19887/pure-css-ie6-minwidth/