IE6 中的 PNG 透明度帮助!
我在 IE6 中遇到了 png 透明度问题。 下面是需要修复的代码
<input type="image" alt="rtf" src="/components/i/images/icons/rtf.png"/>
我在这个论坛上看到了一些帖子,但我无法清楚地理解.. 谁能引导我完成修复它的过程吗? 谢谢..
i've a problem with png transparency in IE6..
below is the code which needs to be fixed
<input type="image" alt="rtf" src="/components/i/images/icons/rtf.png"/>
i saw some posts on this forum but i can't understand clearly..
can anyone walk me through the process of fixing it?
thankx..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
该代码中没有任何内容可以修复,因为 IE 已损坏。您可能想在这里查看解决方法: http://www.twinhelix.com/css /iepngfix/
There's nothing you can fix in that code because it's IE that's broken. You may want to have a look here for a workaround: http://www.twinhelix.com/css/iepngfix/
阅读这篇SO帖子。
Read this SO Post.
基本上 IE6 不能正确执行 alpha 透明度。它尝试对 PNG-8 图像(具有布尔透明度)进行透明度处理,但根本无法处理 PNG-24。
这是默认位置。
如果您需要在 IE6 中实现全面的 alpha 透明度,那么您最好的选择是使用一个脚本,该脚本引入了使其工作的技巧。有 supersleight 非常慢。或者更好的选择是 DD_BelatedPNG ,它不依赖于 AlphaImageLoader。
Basically IE6 doesn't do alpha transparency properly. It has a go at doing transparency with PNG-8 images (with boolean transparency), but can't handle PNG-24 at all.
That's the default position.
If you need full-blown alpha transparency in IE6, then your best option would be to use a script which introduces hacks that make it work. There is supersleight which is quite slow. Or a better option which is DD_BelatedPNG which doesn't rely on the AlphaImageLoader.
我应该指出,如果应用了修复程序,IE 在使用透明 PNG 时会出现很多问题。这是因为 AlphaImageLoader 有一个重大缺陷,可能会导致浏览器挂起。 此链接提供了有关针对 lockukp 的修复的更多详细信息。 然而,在我的测试中,即使如此广泛的修复也还不够。在查看带有 PNG 的页面时,我们仍然遇到 IE6 浏览器锁定的情况。
您可以通过使用 8 位 alpha 通道 PNG 来以不同的方式解决该问题,即在 IE 中进行优雅降级。没有多少工具可以做到这一点,但您可以找到信息 此处和此处。 8 位图像不会使 IE 崩溃,并且在 IE7+ 和所有其他浏览器中看起来效果良好。 IE6 将看到没有透明部分的图像。这对于您的设计来说可能是可以接受的。如果不是,如果您关心 IE6,我会考虑更改设计。它根本不稳定。
I should point out that IE is very buggy when using transparent PNGs if you have the fix applied. This is because the AlphaImageLoader has a major flaw which can cause the browser to hang. This link has more details about a fix that works around the lockukp. However, in my testing, even that extensive fix was not sufficient. We still experienced IE6 browser lockups when viewing pages with PNGs on them.
You can work around the problem in a different way, with graceful degredation in IE, by using 8-bit alpha-channel PNGs. Not many tools can do this, but you can find information here and here. The 8-bit images won't crash IE, and will look good in IE7+ and all other browsers. IE6 will see images without the transparent parts. This may be acceptable for your design. If not, I'd consider changing the design if you care about IE6 at all. It simply isn't stable.
不要将 PNG24 用于图标。将图标转换为 PNG8 并粉碎元数据。这解决了 IE6 Bug,节省流量并使您的页面更快。
您可以使用 pngout 进行转换。要粉碎 PNG,您应该使用 pngout,advpng, optipng 和 pngcrush
如果粉碎元数据部分比较复杂,只保存图像为 PNG8 :)
Don't use PNG24 for icons. Convert the icons into PNG8 and crush the meta-data. This solves the IE6 Bug, save traffic and make your page faster.
You can use pngout for conversion. For crushing the PNGs you should use pngout, advpng, optipng and pngcrush
if the part with crushing meta-data to complicated, only save the image as PNG8 :)