min-width in IE

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

min-width in IE

Post 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?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

IE's box-model is broken to your advantage here. In IE "width" behaves like "min-width" in the other browsers ;)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post 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?
howardr
Forum Newbie
Posts: 17
Joined: Mon Oct 31, 2005 1:33 pm

Post 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.
Post Reply