在网上查阅了一些博主的技术分享,想在这里做一个summary,方便后期查阅记忆
参考来源:
https://blog.csdn.net/sinat_33915360/article/details/86504970
https://www.zhangxinxu.com/study/201007/pie-ie-css3-demo.html (技术总结--大佬这里还有很多c3的兼容处理!赞!)
PIE.htc下载地址:http://css3pie.com/download/
![](https://img.haomeiwen.com/i8140656/b56210b3b68eecef.png)
border-radius
box-shadow属性的使用同理
引入PIE.htc可以解决ie低端浏览器不能设置圆角边框的特效。
使用方法很简单,只要在你想要设置圆角的那个对象那里加入下面三行代码:
且注意PIE.htc的路径是针对于html文档来说的,而不是从css开始出发写路径,即下面的demo工程截图为
![](https://img.haomeiwen.com/i8140656/b1aef456499d4841.png)
所以在css那边写的引用PIE.htc是 behavior: url(PIE.htc);而非 behavior: url(../PIE.htc);
position: relative;
z-index: 2;
behavior: url(PIE.htc);
下面是一个小demo
c3圆角的ie8兼容.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<input type="text" class="search">
</body>
</html>
index.css
.search {
position: relative;
z-index: 2;
width: 150px;
height: 50px;
border:0;
background: lightskyblue;
border-radius: 10px;
behavior: url(PIE.htc);
}
背景颜色透明
position: relative;
z-index: 2;
behavior: url(PIE.htc);
background: rgba(0, 0, 0, 0.55);
-pie-background: rgba(0, 0, 0, 0.55);
网友评论