Main Posts

the ie hack to end all ie hacks

July 21, 2004

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

Additional Content

Hi, I'm Valette

I'm a photographer based out of Anchorage, Alaska. I've recently become a wife, a stepmother, and a homeowner. Life is pretty awesome. You can email me anytime. Learn more...

Recently Tweeted

Also: catching up on Game of Thrones. #adultweek 1 hour ago

Just dropped the boy off for JROTC orientation camp. AKA I'm eating every home meal #nopants for the next week. 1 hour ago

Ah well. I'm still going to bed. Shit can get done another day. 10 hours ago

Get Shit Done time interrupted by a very important Minecraft Show and Tell. 10 hours ago

Okay one half hour of the Get Shit Done hat and then I'm going to bed. 10 hours ago

Recently Photographed

Recently Read

Archives

Also On