通过调用 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 下载下来,放到自己的服务器上,可能加载更快。

相关文章:

  • 2021-08-03
  • 2022-12-23
  • 2021-10-07
  • 2021-08-11
  • 2022-12-23
  • 2021-11-16
  • 2021-10-09
  • 2022-12-23
猜你喜欢
  • 2022-01-14
  • 2021-06-13
  • 2022-02-28
  • 2022-12-23
  • 2021-09-29
相关资源
相似解决方案