Tuesday, March 11, 2008

Minimum width for IE6 browser

A very handy CSS command that exists is the min-width command, whereby you can specify a minimum width for any element. This can be particularly useful for specifying a minimum width for a page.

Unfortunately, IE doesn't understand this command, so we'll need to come up with a new way of making this work in this browser. First, we'll insert a

under the tag, as we can't assign a minimum width to the browser
Next we create our CSS commands, so as to create a minimum width of 600px:

#container
{
min-width: 600px;
width:expression(document.body.clientWidth <> 1200? "1200px" : "auto");
}

1 comment:

Anonymous said...

not working man :(