让IE88兼容识别css3选择器——selectivizr-min.js

Posted hpx2020

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了让IE88兼容识别css3选择器——selectivizr-min.js相关的知识,希望对你有一定的参考价值。

技术图片

 

html:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <link type="text/css" rel="stylesheet" href="css.css" />
    <script type="text/javascript" src="jquery-1.8.3.min.js"></script>
    <!--[if (gte IE 6)&(lte IE 8)]>
    <script src="selectivizr-min.js"></script>
    <![endif]-->

</head>
<body>

<div id="xx">
    <p haha="tit">第一</p>
    <p haha="tit">第二</p>
    <p><input type="text" placeholder="sdf"></p>

</div>

</body>
</html>

  

 

css:

//css.css

*{margin: 0;padding: 0;}
p:nth-child(2){background: #ccc;color: red;}
p:last-child{background: yellow;color: red;}
p:last-child input:focus{background: green;color: #fff;}
p:first-child{background: pink;color: red;}

 

经过测试也并没有像作者说的那样兼容这么多选择器,但是常用的还是兼容的。使用时基本和jquery配合使用不然不起作用。

优势就是可以把样式写在样式文件中。

selectivizr-1.0.2

http://selectivizr.com/

以上是关于让IE88兼容识别css3选择器——selectivizr-min.js的主要内容,如果未能解决你的问题,请参考以下文章

ie6的常见兼容性问题

让一些旧浏览器变牛逼的库 ========兼容性

CSS选择器的兼容性

IE9以下浏览器对CSS3的常用兼容处理

浏览器兼容

三十九CSS3的新特性(上)