Return to Snippet

Revision: 31394
at September 4, 2010 01:48 by stephcode


Initial Code
<html>
<head>
<style>blah { color: red; }</style>
<script>document.createElement("blah")</script>
</head>
<body>
<blah>Hello!</blah>
</body>
</html>

Initial URL
http://ejohn.org/blog/html5-shiv/

Initial Description
Thankfully, Sjoerd Visscher mentioned an interesting technique  that could be used to force IE to use the specified CSS styling. Specifically, once you create a new DOM element (of the same name as the one in the document) all styling is applied. [...] This is very important. This now means that we can provide CSS styling for undefined HTML 5 element and allow Internet Explorer to handle it gracefully.

Initial Title
Create new DOM element

Initial Tags
javascript, DOM

Initial Language
JavaScript