Which box model hack do you use?

Here are a summary of the hacks.

http://css-discuss.incutio.com/?page=BoxModelHack

I got the Tantek hack to work but not Tantek’s midpass hack. Just interested in which one is most popular with current developers.

Using IETester to validate.

(I suppose the very best way is to design around the hack altogether.)

To be honest I nevert need to use hacks in my code :). Most good ones don’t. There just isn’t a need :).

The box model hack is intended for IE prior to IE6. I wouldn’t bother with that old beast…

But if you still want/need to support that old browser, there shouldn’t be a need for the box model hack: the IE box-model problem can be avoided by not assigning problematic properties and values to sized containers. Instead, apply padding and/or margins to the “liquid elements” contained within
the “sized” elements.


#left-column { 
width:200px; 
height:auto; 
padding:5px; 
border:3px solid #600; 
} 

can be replaced with:


#left-column { 
width:200px; 
height:auto; 
}

Then, you can use a nested div to display the removed attributes:


div.nest { 
padding:5px; 
border:3px solid #600; 
} 

The nested div will flow within the constraints of the parent without causing any spacing issues between the parent div and neighboring elements. (liquid as in a glass of water)

Of course, you don’t need to use a nested div, but you can apply padding to the other elements such as paragraphs, images, lists.

I think I should mention I did the backslash hack (which is also called in there, the modified SBMH hack (when I bothered with it a long time ago))