Using HTML5-compatible low-version browsers

Source: Internet
Author: User

Because HTML5 new semantic tags, in the lower version of the browser can not be recognized, for example, you wrote a header tag, wrote a text, in the lower version of the browser, it must be able to see, but that is he does not know the header tag, but only the content of the display, If you add a style to the header, it's definitely not possible, and all we have to do is let the lower version of the browser know and parse our HTML5 tag.

Other people's solution, I copy come over, is self-tested.

The first method:

<!--[If Lt IE 9]>
<script src= "Http://html5shiv.googlecode.com/svn/trunk/html5.js" ></script>
<! [endif]-->

At the head of the header, this code is added at the front to achieve faster parsing under the lower version of the browser. Add the above code and you'll be able to use the HTML5.

The second method:

<!--[If LT IE 9]><script> (function () {if (!/*@[email protected]*/0) Return;var e = "Header,footer,nav, Article,section ". Split (', '), I=e.length;while (i--) {document.createelement (e[i])}) () </script><! [endif]-->

The e-string above, is the HTML5 tag you want to use, you can add the tags you want to use, and in the CSS add such a sentence, let their performance show its original block elements

 

/*html5*/article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block}

  

This article on the Internet is still a lot of, in fact, can solve the problem, in the current browser support HTML5 probability, in fact, can use HTML5

Reference article:

Http://www.cnblogs.com/Capricornus/archive/2013/03/26/2982122.html

Using HTML5-compatible low-version browsers

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.