Html5 Not Rendering Header Tags In Ie
Solution 1:
In addition to my comment above, you don't need the html5shiv for IE9, which I'm sure you know.
Chances are there are some HTML problems elsewhere as IE doesn't try and fix things for you the way other browsers do.
The reason that <!--[if lt IE ]> <![endif]-->
doesn't work is that you need to remove the lt so that it simply reads <!--[if IE]> <![endif]-->
Based on your reply above regarding the JS file, I'd try:
<!--[if lte IE 9]><script src="js/html5shiv.js"></script> <![endif]-->
And
<!--[if IE]><script src="html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
is wrong. You need to have the http://
in front of the html5shiv
.
A link to the website in question would be ideal.
UPDATE I see what's wrong now, you're missing a doctype! Add:
<!doctype html>
to the top of the file and it will be fine.
If no doctype is specified, IE always resorts to Quirks mode (which you never want!)
You also have multiple <head>
elements which is wrong. And everything needs to be enclosed in a <html>
element.
Actually there's a lot wrong with the markup, you don't even have a <body>
element!
Solution 2:
If fact, simply create the elements without even add it to the DOM will allow IE (even 6) to recognize it. So
<scripttype="text/javascript">document.createElement("'header'");
document.createElement("'nav'");
document.createElement("'article'");
document.createElement("'section'");
document.createElement("'footer'");
</script>
will solve your problem. You can reduce it to
'article aside footer header nav section time'.replace(/\w+/g,function(n){document.createElement(n)})
found here: http://www.hagenburger.net/BLOG/Simple-HTML5-Fix-for-IE.html
Post a Comment for "Html5 Not Rendering Header Tags In Ie"