[CSS Hack] border-color:transparent & filter+ClearType bug

时间:2023-02-04 23:42:24

IE6不支持设置transparent为边框的颜色。

例如:
border:solid 1px transparent;

[CSS Hack] border-color:transparent & filter+ClearType bug

解决方法:
border:solid 1px transparent;
/*set an unused color to be index color*/
_border-color:tomato; /*For IE6-*/
/*then remove this indexed color*/
_filter:chroma(color=tomato);/*For IE6-*/

结果如下:
[CSS Hack] border-color:transparent & filter+ClearType bug

边框是没了,可字体怎么。。。
主意,以上现象是只有在打开系统的ClearType时才会看到的,如果把ClearType关掉就没问题了,见下:
[CSS Hack] border-color:transparent & filter+ClearType bug 
关于这个问题的一个演示页面:
http://icant.co.uk/sandbox/msieopacityissue/
另:
http://www.hedgerwow.com/360/bugs/fix-ie-opacity-text.html

解决方法:
border:solid 1px transparent;
background-color:#BFDBFF;
/*set an unused color to be index color*/
_border-color:tomato; /*For IE6-*/
/*then remove this indexed color*/
_filter:chroma(color=tomato);/*For IE6-*/
 

[CSS Hack] border-color:transparent & filter+ClearType bug 
搞了半天边框是透明了,底色又不透明了,汗!!!