How to make the old browser compatible with HTML5 new tags

Source: Internet
Author: User

CSS styles set default styles:

<style>

Article, aside, canvas, details, figcaption, figure,

Footer, Header, Hgroup, menu, nav, section, summary

{

Display:block;

}

</style>

JS in:

<!--[If Lt IE 9]>

<script type= "Text/javascript" >

var e= ("Abbr,article,aside,audio,canvas,datalist,details," +

"Figure,footer,header,hgroup,mark,menu,meter,nav,output," +

"Progress,section,time,video"). Split (', ');

For (Var i=0;i<e. length;i++) {

Document.createelement (E[i]);

}

</script>

<! [endif]-->

=========================================================

Another way is to use the framework of the method, with the conditional comment plus JS code implementation

The code is as follows:


<!--[If Lt IE 9]>

<script src= "Html5shiv.js" ></script>

<! [endif]-->


This code can be directly added to achieve compatibility issues, about the conditions of attention in the


is to determine whether the following browser is less than IE9, if it is to execute this JS code, if not, ignore it. As for the JS link directly open to see it, is also a large section of the code.

How to make the old browser compatible with HTML5 new tags

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.