Tantek hack or box-sizing

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Which method is to be preferred to prevent that padding is added to the box
The Tantek hack or adding   -moz-box-sizing: border-box;    box-sizing:
border-box; to the properties of the div?


Re: Tantek hack or box-sizing

Quoted text here. Click to load it

I seldom find the need to use any hacks. Anywhere I have a fixed size I
simply don't use padding, I just disregard it as an option. But that's
because usually I have a few "container" <div>s that are fixed size without
padding. All the block elements inside these containers naturally stretch to
fill the full width, so I add margins to these, or I can add padding to the
sub elements as well, because they don't have a size explicitly set.

Basically I use alot of margins to place my boxes around inside padding-less
"fixed size" block elements.

But don't trust me, I have a strange negative-margin fetish. Which is
probably just as bad as using hacks, I guess.

Re: Tantek hack or box-sizing

Nico Schuyt wrote:

Quoted text here. Click to load it

The Tantek hack IIRC gives an IE-specific width, followed by a syntax that
hides the rest of the style from IE so reasserts the correct width.

The -moz-box-sizing is only supported by Mozilla (AIUI).

So the question you need to answer is - what do you need to happen to CSS
capable browsers other than IE and recent versions of Mozilla? Answer that,
and you'll also have an answer to your question.

FAQs: http://html-faq.com http://alt-html.org http://allmyfaqs.com /
Recommended Hosting: http://www.affordablehost.com /
Web Standards: http://www.webstandards.org /

Site Timeline