Using HTML5 tags without JavaScript in IE
HTML5 is all the rage at the moment. All the cool kids are doing it.
Dear old IE, however, doesn’t allow you to use the new tags, such as <article>, <nav> etc in your CSS.
There is the popular ‘HTML5Shiv’ which basically does the following in JavaScript:
document.createElement("article");
document.createElement("nav");
But what if you have to make your sites work 100% in IE without JavaScript? Well, you can do the following using conditional comments:
Obviously then, you need to use the classnames, not the elements themselves in your CSS.
Ugly? Yes. But it works!
About this entry
You’re currently reading “Using HTML5 tags without JavaScript in IE,” an entry on fakedarren
- Published:
- 8.14.10 / 1pm
- Category:
- Uncategorized
- Tags:
3 Comments
Jump to comment form | comments rss [?] | trackback uri [?]