Reprinted: Let IE6 support HTML5 Elements

Source: Internet
Author: User

Today, I changed the webpage to HTML5. After debugging, It was displayed as normal in ff and opera, but it became completely invisible to ie6. Google once discovered the html5shiv project, which can convert the HTML5 new elements into the content recognized by IE6. The author has already written this sectionCodeOn the Google Code project, you only need to call this code in your head:

    1. <! -- If lt ie 9]>
    2. <SCRIPT src = "http://html5shiv.googlecode.com/svn/trunk/html5.js"> </SCRIPT>
    3. <! -- Endif] -->

Of course, you can also directly download this file to your website. This file must be called in the head label, because IE must know these elements before parsing the element to enable function! You may need to add the following code to your CSS file. Otherwise, some inexplicable problems may occur.

    1. Header, NAV, article, section, aside, footer {display: block ;}

In addition, excanvas. JS is a script written by Google for IE6 that supports Canvas elements. There are detailed examples in it. If you are interested, you can try it.

Kill IE6

I also get bored with the special characteristics of IE6, so I also added the kill IE6 family. All the friends who visit my website using IE6 will go out of the kill IE6 dialog box, the premise is that your browser allows the execution of JS files. The method is simple. You can add the following code before your website </body>:

    1. <! -- If lte ie 6]>
    2. <SCRIPT src = "http://letskillie6.googlecode.com/svn/trunk/letskillie6.zh_CN.pack.js"> </SCRIPT>
    3. <! -- Endif] -->

IE judgment statement

Written above <! -- If lte ie 6]> it is a comment in normal HTML and will not be executed, but it is a judgment statement in IE, therefore, these codes are recognized and loaded only in IE.

LTE: Short for less than or equal to, that is, less than or equal.

LT: Short for less than, that is, less.

GTE: Short for greater than or equal to, that is, greater than or equal.

GT: Short for greater than, that is, greater.

! : It means not equal to, which is the same as the non-equal identifier in JavaScript.

Source Document

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.