IE9以下浏览器处理方案_ html5shiv.js和respond.min.js

做页面常用的东西,写这里用的时候省点去找了。。。

html5shiv:解决ie9以下浏览器对html5新增标签的不识别,并导致CSS不起作用的问题。

respond.min:让不支持css3 Media Query的浏览器包括IE6-IE8等其他浏览器支持查询。

由于IE6/IE7/IE8还有很大一部分用户,为了让网站浏览者都能正常的访问HTML5网站,故这两种方案还是需要的,

下面是两个解决方法的cdn地址写法:

<!--[if lt IE 9]>

  <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.js"></script>

   <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>

<![endif]—>

另外可用:

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->


猜你喜欢

转载自blog.csdn.net/h330531987/article/details/79732152