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:
- <! -- If lt ie 9]>
- <SCRIPT src = "http://html5shiv.googlecode.com/svn/trunk/html5.js"> </SCRIPT>
- <! -- 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.
- 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>:
- <! -- If lte ie 6]>
- <SCRIPT src = "http://letskillie6.googlecode.com/svn/trunk/letskillie6.zh_CN.pack.js"> </SCRIPT>
- <! -- 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