让旧浏览器识别新元素

不能识别的HTML5元素的旧浏览器会自动将这些元素作为内联元素来处理。因此,为使旧浏览器正常显示你需要在左侧添加CSS代码行,在该行中指出哪些新元素作为块级元素呈现在页面上。

<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <style type='text/css'>
            header, section ,footer, aside, nav, article, figure {
                display: block;
            }
        </style>
    </head>
    <body>
        <div>TODO write content</div>
        <!--[if lt IE 9]>
        <script src="http://html5shiv.googlexode.com/svn/trunk/htlml5.js"><?script>
        2<![endif]-->        
    </body>
</html>

 

posted @ 2018-08-13 16:30  梦人亭  阅读(110)  评论(0编辑  收藏  举报