[thelist] RE: How does "Box-in-a-box" hack work?

Joshua Olson joshua at waetech.com
Thu Jul 15 12:43:19 CDT 2004


> -----Original Message-----
> From: John.Brooking at sappi.com
> Sent: Thursday, July 15, 2004 1:09 PM
>
> But is it a good
> thing, long term, to train yourself to think the "the wrong way"? Will we
> all have to make a big adjustment to our thinking someday, when all the
> browsers in use finally adhere to the W3C standard? (True, we could still
> keep on using the hack anyway, but that will certainly become gauche
> someday, like using tables is today!)
>
> Having said this, I'll probably do it anyway. Open to comments.

John,

In my opinion, the "correct" box model is much less intuitive.  If you
wanted to have a region that filled up 50% of the space, has a 20-pixel
colored border, and a 1em padding on the inside of that border, you couldn't
with the "correct" box model with a single div.  Heck, you couldn't even do
it using the technique supplied by Tom.  With the Box-in-a-Box method, or
using IE's "broken" box model, this is a cinch.

On the other hand, I'm sure there are benefits to the "correct" box model
that are not so obvious.  Sooo....

If I would have been asked during the initial planning of the box model, I
would've suggesting adding a "box-model" CSS element that would allow the
designer to select which model (width=content or width=outer bounds.. then
same for height) to apply to a single element.

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168




More information about the thelist mailing list