PIE让IE支持CSS3圆角阴影渐变等效果

本文介绍了一款名为PIE的工具,它能够使Internet Explorer 6-9支持部分CSS3特性,包括边框圆角、阴影、渐变等。作者通过实际案例演示了如何在网站中应用PIE,特别提到了节省处理图片时间的效果。建议使用最新版的PIE以修复已知BUG。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近做网站,想用CSS3,但IE真是个蛋疼的货,对CSS3的支持实在。。。最后有一天在github上发现了PIE,PIE网站上的介绍:

   PIE makes Internet Explorer 6-9 capable of rendering    several of the most useful CSS3 decoration features.

 

目前,PIE支持的CSS3属性主要有:

 

 

 

border-radius
box-shadow
border-image
CSS3 Backgrounds (-pie-background)
Gradients  
 

 

我在网站中主要使用了  border-radius,box-shadow gradients,整体来说,比使用图片方便,特别是渐变背景和圆角,节省 了很多处理图片的时间。就我目前使用的情况来看,这个项目的前景还是不错的,特别是在国内,IE盛行。。

 


PIE使用还是比较简单,以渐变为例:

behavior: url(/assets/PIE.htc); //PIE的文件放在位置
position: relative;
background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #2DABE6), color-stop(100%, #6789C0));
background: -webkit-linear-gradient(#2DABE6, #6789C0);
background: -moz-linear-gradient(#2DABE6, #6789C0);
background: -o-linear-gradient(#2DABE6, #6789C0);
background: -ms-linear-gradient(#2DABE6, #6789C0);
-pie-background: linear-gradient(#2dabe6,#6789c0); //这句不可以少
background: linear-gradient(#2DABE6,#6789C0);  
 

同样,如果要用阴影:
behavior: url("/assets/PIE.htc");
position: relative;
-moz-box-shadow: #adadad 0px 0px 2px;
-webkit-box-shadow: #adadad 0px 0px 2px;
-o-box-shadow: #adadad 0px 0px 2px;
box-shadow: #adadad 0px 0px 2px;  
 

圆角:
behavior: url("/assets/PIE.htc");
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
-o-border-radius: 2px;
-ms-border-radius: 2px;
-khtml-border-radius: 2px;
border-radius: 2px; 
 

如果三个效果放在一个class中,可以只用一次behavior就可以了

如果使用PIE,请使用最新的beta5,处理了不少BUG。。pie项目地址:

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值