Previous Message
Next Message

Box Model Hack

Sent by Zoe M. Gillenwater on 2 December 2004 16:04


David Sharp wrote:

>Could someone please clarify this for me?
>
>I was reading on Eric Meyer's blog today....
>
>    "Furthermore, IE6 fixed a number of parsing bugs that existed in previous versions. One of
those was the bug on which Tantek Çelik's "Box Model Hack" depended. However, the parsing bug was
fixed in both quirks and standards modes, so the BMH utterly failed to work in IE6 no matter what
DOCTYPE you used. That actually did break quite a few layouts, if I remember correctly."
>  
>

I think what he means is that the original BMH only works if IE6 is in 
standards mode.  This is because when it is in quirks mode, it emulates 
IE5.x's broken box model, but the hack does not target it, so in this 
case the BMH only fixes IE5.x, not IE6.  If you're in standards mode, 
though, this is a non-issue.

>Is the BMH still the correct way to cope with the incorrect Box Model for IE/win 5.0 and 5.5 ? If
IE/win6 has fixed the bug on which the BMH depended, but also fixed its Box Model surely these two
together would mean business as usual....I don't understand why this would break layouts.
>  
>

There's no "correct" way to hack the box model, but this hack is much 
simpler and easier to use and understand, IMO:
http://www.info.com.ph/~etan/w3pantheon/style/modifiedsbmh.html

That being said, you can almost always avoid the broken box model 
altogether by using margins on inner content instead of padding on the 
box itself.

Zoe

-- 
Zoe M. Gillenwater
Design Specialist
Highway Safety Research Center
http://www.hsrc.unc.edu

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: