Allow lower versions of IE browsers to support HTML5

Internet Explorer browser issues

You can use the above method to add HTML5 elements for IE browser, but:


we can use "HTML5 Enabling JavaScript", " shiv" created by Sjoerd Visscher to solve this problem:
<!--[if lt IE 9]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

The above code is a comment, the function is in IE When the browser version is less than IE9, it will read the html5.js file and parse it.

Note: Domestic users please use the static resource library of this site (Google resource library is unstable in China):
<!--[if lt IE 9]>
  <script src="http://cdn.static.runoob.com/libs /html5shiv/3.7/html5shiv.min.js"></script>

<![endif]-->


For IE browser html5shiv is a better solution. html5shiv mainly solves the problem that the new elements proposed by HTML5 are not recognized by IE6-8. These new elements cannot be used as parent nodes to wrap child elements, and CSS styles cannot be applied.

Guess you like

Origin blog.csdn.net/sweetsoft/article/details/78733391