【html5】让 ie 支持 html5 标签
通过调用 html5.js 可以使 ie6,7,8 支持 html5 标签。
js 地址点击这里。
js 引用方式:
<!--[if lt IE 9]> <script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
最后附上 demo:
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> .wrapper{width:1000px;margin-left:auto;margin-right:auto;} #header{height:100px;background:gray;} #content{height:500px;background:green;} #footer{height:100px;background:gray;} </style> <!--[if lt IE 9]> <script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div class="wrapper"> <header id="header">header区域</header> <section id="content">内容区域</section> <footer id="footer">footer区域</footer> </div> </body> </html>
PS:可以将 js 下载下来,放到自己的服务器上,可能加载更快。