the ie hack to end all ie hacks
jr found a spiffy little gem on the webmasterworld forums that will (supposedly) negate the need for hundreds of ie hacks in your css toolbox.
it all comes down to adding 'display:inline' to offending floats and 'display:inline-block' to offending parent containers. the little i have played around with it, it seems to do the trick on all the ie css bugs:.
the only problem i see with using 'display:inline-block' is that, well, its not a valid css property. so if your value as a human being rests on having your site valid xhtml strict and valid css, then you should probably not use it.
this article needs to get published in a more public venue and get a ton of attention.
i somehow doubt my site and the ink stained banana is going to generate that attention.
3 Comments
I've given up on valid xhtml. If it works in every browser, and no-one complains about funny happenings when they visit my pages, I refuse to spend anymore wasted hours routing through code and wondering why a sentence in italics is giving me a great big error.
I'm leaning in the same direction as far as CSS, Lynne. I've always liked to think of it as a point of pride that my XHTML and my CSS validates, and have gone to great lengths to circumvent the box-model problems with valid CSS.
Nowadays, it's just not worth it anymore. I'd rather actually get things done. So, browser hacks in CSS are acceptable.
XHTML is different, because IE actually doesn't do a bad job with it. XHTML Transitional is mostly a cleaned-up version of HTML 4.0, and XHTML Strict is a subset of Transitional. So, apart from a couple of quirks, no real problems there. When your XHTML doesn't validate, the fix rarely breaks anything in IE. Most of the time when people blame IE for XHTML problems, they really mean CSS.
You say that inline-block is not a valid CSS property.
IT IS! See http://www.w3.org/TR/CSS21/visuren.html#display-prop