HTML5在IE浏览器下运行代码

146 阅读1分钟

需要添加条件编译模式

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <meta name="viewport" content="width=device-width, initial-scale=1.0">    <meta http-equiv="X-UA-Compatible" content="ie=edge">    <title>html5shiv</title>    <style>    .article{        font-size:40px;        color:red;    }    </style>    <script>        (function(){            if(!            /*@cc_on!@*/            0)return;            var e = "abbr,article,aside,audio,canvas,datalist,details,dialog,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(', ');            var i = e.length;            while (i--){                document.createElement(e[i]);            }        })();    </script></head><body>    <article>        YOEDWENJNJ那就看·哇塞    </article></body></html>