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

Joshua Olson joshua at waetech.com
Wed Jul 14 13:20:14 CDT 2004


> -----Original Message-----
> From: John.Brooking at sappi.com
> Sent: Wednesday, July 14, 2004 1:54 PM
>
> A related discussion (which I'll bring up myself because I'm sure if I
> don't, someone else will) is whether this is a desirable hack to use,
> because it involves hacking the HTML rather than just the CSS. As [1] says
> about it, "... years down the road, when a hack is finally
> cleaned from your
> code, a CSS hack is quickly removed, while markup hacks are
> scattered hither
> and yon. Plus it complicates the HTML, structurally speaking." I
> appreciate
> both those arguments, but here's a counter-argument I'm having
> with myself:
> In the years before this hack can finally be cleaned up, how many
> times am I
> going to have to code around this, constantly calculating two sets of
> numbers in order to use Tantek, SBMH, or some other pure CSS hack, and how
> much more total time and effort will that take than cleaning up all the
> markup hacks *once* at some future date? Especially if most of the markup
> hacks are isolated in a few templates, rather than embedded "manually" in
> each and every page? Comments?
>
> [1] http://css-discuss.incutio.com/?page=BoxModelHack

John,

Personally, I lean towards the box-in-a-box "hack" in most cases.  Like you
mentioned, it doesn't really rely on on hacks per se, and it doesn't rely on
calculating numbers.  Also, it's extremely universal WITHOUT any css hacks.
It adds to the structure of the page, but it's likely that you won't need to
clean up this hack in the future.  With other hacks, you'll continually need
to work around more and more browser quirks as new versions of browsers are
released.  With box-in-a-box, you are simply skirting the issue... newer
versions of browsers simply don't affect it.

In a nut-shell, I find that using box-in-a-box generates HTML that is less
buggy, and works on more browsers.  Additionally, I find that I'm done
coding MUCH quicker (which is roughly equivalent to $$ in my pocket).  I
don't need to test as heavily on as many browsers because I know that no
common browser chokes on the technique since it's not really a css hack.

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




More information about the thelist mailing list