More and more sites are starting to use HTML5 tags. But the current situation is that there are still many people using IE6,IE7,IE8. In order for all Web site visitors to access the site normally, the solution has the following two:
- Create more than one set of templates for the site, through the program of User-agent to different browser users to display different pages, such as Youku is the use of this mode.
- Use JavaScript to enable browsers that do not support HTML5 to support HTML tags. Many websites currently use this approach.
The better solution for IE browser is Html5shiv. Htnl5shiv Main solution HTML5 proposed new elements are not recognized by ie6-8, these new elements cannot wrap child elements as parent nodes, and CSS styles cannot be applied. It is possible to apply CSS styles to unknown elements by simply performing document.createelement (elementname). Html5shiv is created based on this principle.
Html5shiv is very simple to use, considering that IE9 is support HTML5, just add the following code to the head of the page:
<! –[if lt IE 9] > < src= "Http://html5shiv.googlecode.com/svn/trunk/html5.js"></ Script><! [endif]– >
Html5shiv Official website: http://code.google.com/p/html5shiv/
Use Html5shiv to let ie6~8 support HTML5