[thelist] is the box model hack unnecessary in ie6?

Scott Schrantz scotts at rci-nv.com
Fri Nov 15 13:51:01 CST 2002


> -----Original Message-----
> From: Chris W. Parker [mailto:cparker at swatgear.com]
>
> anyways... am i correct in assuming that the box model hack as
> illustrated at
> http://www.tantek.com/CSS/Examples/boxmodelhack.html does
> not apply to IE6 because the top box is as wide as the blue bar?
>
> i mean, if i was using ie5 the top box would be as large as
> the red bar and NOT as wide as the blue bar correct? using
> the hack would correct this mistake in ie's implementation
> thus making the second box as big as the blue bar?

Right. Basically the hack is a way of sending IE5 a different value than
IE6. Think of it almost as bug-based browser sniffing.

div.content {
  width:400px;
  voice-family: "\"}\"";
  voice-family:inherit;
  width:300px;
}

IE5 chokes on all the voice-family stuff and only sees the 400px value. IE6
sees both values, and since 300px comes later it uses it. The idea is that
the number you give IE5 is the IE6 value + both paddings + both borders (300
+ 30 + 30 + 20 + 20 = 400). That makes the boxes the same size in both
browsers.

If you're on an intranet where there's only IE6, you don't need the hack.
The same goes for an all-IE5 intranet. The hack is only for situations where
you'll have both versions visiting the same page, and you need to give them
different values.

--
Scott Schrantz
work: www.rci-nv.com
play: www.computer-vet.com



More information about the thelist mailing list