Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html5 new elements (header, nav, footer, ..) not working in IE

Tags:

html5 new elements (header, nav, footer, ..) not working in IE

like image 233
dragonfly Avatar asked Mar 08 '11 01:03

dragonfly


People also ask

Does IE work with HTML5?

Internet Explorer 11 supports HTML5 and there shouldn't be any problem in YouTube.

How do I create a header footer and nav in HTML?

Semantic Elements in HTML Many web sites contain HTML code like: <div id="nav"> <div class="header"> <div id="footer"> to indicate navigation, header, and footer.


2 Answers

You need to include the HTML5 shiv script in order to allow styling of HTML5 elements in older IE browsers: http://code.google.com/p/html5shiv/

To use, include the following script in your element above your CSS:

<!--[if lt IE 9]> <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script> <![endif]--> 
like image 171
mVChr Avatar answered Dec 13 '22 04:12

mVChr


You need to use HTML5 Shim. Here is a detailed explanation as to why this is needed.

To use HTML5 Shim, you just need to add the following within your page's <head> above all your CSS declarations:

<!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> 
like image 41
Andrew Marshall Avatar answered Dec 13 '22 02:12

Andrew Marshall