码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2019-05-06 19:02:31      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:技术   idt   inpu   last   child   兼容   style   ref   作者   

技术图片

 

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

标签:技术   idt   inpu   last   child   兼容   style   ref   作者   

原文地址:https://www.cnblogs.com/hpx2020/p/10821098.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!