透明PNG的IE6问题 [英] IE6 issues with transparent PNGs
问题描述
我习惯了,如果我想/需要以跨浏览器的方式使用alpha-trans PNG,我使用一个div的背景图像,然后,在IE6的CSS,标记背景为无,并包含适当的过滤器参数。
I've gotten used to the idea that if I want/need to use alpha-trans PNGs in a cross-browser manner, that I use a background image on a div and then, in IE6-only CSS, mark the background as "none" and include the proper "filter" argument.
有另一种方法吗?一个更好的方法?有没有办法做到这一点与img标签,而不是背景图片?
Is there another way? A better way? Is there a way to do this with the img tag and not with background images?
推荐答案
底线是,如果你想alpha透明度在一个PNG,你想它的工作在IE6,那么你需要应用AlphaImageLoader过滤器。
The bottom line is, if you want alpha transparency in a PNG, and you want it to work in IE6, then you need to have the AlphaImageLoader filter applied.
现在,有很多方法来做:浏览器特定的hack,条件注释,JavaScript / JQuery / JLibraryOfChoice元素迭代,服务器端CSS通过UserAgent嗅探...
Now, there are numerous ways to do it: Browser specific hacks, Conditional Comments, Javascript/JQuery/JLibraryOfChoice element iteration, Server-Side CSS-serving via UserAgent-sniffing...
但是所有的要应用过滤器并移除背景。
But all of 'em come down to having the filter applied and the background removed.
这篇关于透明PNG的IE6问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!