IE6不支持PNG图片的透明效果,逛一个老外的网站的时候发现一个蛮不错的方法:
先下载文件 文件下载
该方法特点:
- Automatic activation of transparency for PNGs in the page.
- Support for <IMG SRC=”"> elements.
- Support for background PNG images (unlike many other scripts!)
- Background images can be defined inline or in external stylesheets.
- Automatically handles changed SRC/background via normal JavaScript (e.g. mouseover rollovers) — no special coding needed.
- Change support includes CSS ‘className’ changes on elements.
- Incorporates automatic workaround for <a href=”"> elements within PNG-background elements.
- Tiny script (for fast downloads).
- Licensed under a Free Software license.
简单的一个应用:
#logo { background-image:url(images/logo.png); width:194px; height:83px; }
/* Fix up IE6 PNG Support 实现 img标签和ID为logo的 PNG图片的透明*/
img, #logo { behavior: url(scripts/iepngfix.htc); }
一些具体的注意事项,还有一些遇到的基本问题可以点击查看 点击预览页面
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
You must be logged in to post a comment.