views:

73

answers:

3

What are some good solutions for making my HTML 5 pages compatible with IE (at least IE 7 & 8)?

Is there an industry standard that I can use that will make IE recognize things like <article> and <nav>?

A: 

Sure... don't use features the browser doesn't support. It is honestly that simple.

You are looking for a silver bullet, but one does not exist here. There are alternatives to just about everything. Sure, they aren't pretty, but they are out there.

Brad
+1  A: 

It's very simple: Just use document.createElement('whatever')

http://remysharp.com/2009/01/07/html5-enabling-script/

Pumbaa80
+3  A: 

Yeah, you can run the html5shiv if you want, which is what you seem to be referring to. It'll allow IE to parse the tags initially. But that will still leave you with the same problems if you want to use innerHTML (or framework code based on it). There's the innershiv, but it's not wonderfully efficient and it won't work for all top-level elements.

What do you want to achieve by using the semantic-but-behaviour-free elements like <article>? You will be taking on extra browser problems for little practical benefit. To be honest, I really wouldn't bother, today. It's something for the future.

bobince
I've been reading through diveintohtml5.org and liked the idea of what they were talking about as far as the semantic elements went. With IE 9 coming out and with almost all of the other browsers supporting the html 5 tags, I was curious if there was a standard way people handled IE 7/8.I'm writing HTML on a large website that will be in place for possibly years to come. I'd like it to be as "future" proof as possible while still remaining backwards compatible with older browsers.
cmcculloh
I would do `<div class="article">` for now, reserving the HTML5 element names as class names for this purpose. Then it's a fairly easy automatable change in the future. (Similar to how we do `<input class="text">` now, to work around IE6's lack of support for the CSS attribute selector, whilst making it clear what it means.)
bobince