Use Html5shiv to let ie6~8 support HTML5

Source: Internet
Author: User

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:

    1. 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.
    2. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.