Sjoerd Visscher found a neat way to make styles work on unknown elements in IE-just JS to create this unknown element:
Document.createelement (ElementName)
Similarly (for IE, the HTML5 element is an unknown element), the method can also be postponed to the HTML5 element (see: John Resig wrote "HTML5 Shiv"):
<style>section {color:red;} </style>
<script>document.createelement ("section") </script>
<body>
<section>hello world!</section>
</body>
In IE, in order to make it easier to use the HTML5 element, we can introduce such a script:
Details of the specific application of the case is as follows:
- "Moving markup towards HTML5"
- "Test new HTML 5 Elements"
popularity:5% [?]
(function () {
from:http://dean.edwards.name/weblog/2007/03/sniff/
if (!/* @cc_on!@*/0) return;
var HTML5 = "Abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,
Eventsource,figure,footer,hgroup,header,mark,menu,meter,nav,output,
Progress,section,time,video ". Split (', ');
for (var i = 0, len = html5.length i < len; i++)
Document.createelement (Html5[i]);
}
})();