今天做了一个网站,由于网站页面的个性格话,使我不得不用到png格式的图片,做到一半开始测试浏览器兼容的时候,发现png在IE6下无效,郁闷!在网上搜索了一长篇,有用CSS的filter : progid:DXImageTransform.Microsoft.AlphaImageLoader ( enabled=bEnabled , sizingMethod=sSize , src=sURL ) 个方法,也有用js方法但效果都不是很理想,最终发现了一个htc的方法很好,贴出来与大家分享!
第一步:
下载文件:http://www.xipingbar.com/b/wp-content/uploads/2010/07/iepngfix.zip
第二步:
将压缩文件解压,然后把iepngfix.htc和iepngfix_tilebg.js文件放在网站根目录下
第三步:
在你的Html页面加入如下代码:
第四步:
在你的Css页面加入如下代码:img, div, input { behavior: url(“iepngfix.htc”) }
这时候再看你的png在IE6下就是透明的了!
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.