Page 1 of 1

min-width in IE

Posted: Sat Oct 21, 2006 2:45 pm
by alex.barylski
So I've used it successfully in FireFox, but it doesn't appear to work in IE???

Is there any way to accomplish something similar?

Posted: Sat Oct 21, 2006 2:47 pm
by Chris Corbyn
IE's box-model is broken to your advantage here. In IE "width" behaves like "min-width" in the other browsers ;)

Posted: Sat Oct 21, 2006 2:50 pm
by alex.barylski
That was fast :P

Hmmmmm...but if I use width, then it doesn't take the whole screen...which it should

It's a toolbar...at the top of screen which consumes entire space...but the screen is a box fixed at 760px, but centered in screen. The toobar must fill the screen, but when the window is resized below 760px, the toolbar should stop shrinking, as the content is right justified, it keeps moving to the left even after it should have stopped...because the body (760px) has been passed and horizontal scroll bars have appeared...

Follow me?

Posted: Tue Oct 24, 2006 9:01 pm
by howardr
actually ie treats height as min-height. it strange occasions it does treat width as min-width.

ie does allow for expressions in css. you should try this

Code: Select all

#element
{
    _width: expression((document.documentElement.offsetWidth < 779) ? '779px' : '100%');
}
the underscore ('_') before the attribute will only be recognized by ie (not ie7 which supports min-width), and then will do an expression on it.

the expressions does this: if this element width is less that 779px, then set its width to 779px, else set it to 100%.

you can use this functionality to make ie act like it has min-width.