终于彻底解决了png的透明问题

之前解决png在IE6下的透明解决方案,总是在png使用背景或者src的时候能用,组合在一起就会有问题,今天终于彻底解决这一问题。

  1. <title>关于PNG图片透明的兼容性</title>
  2.  
  3. body {
  4. background:#666666;
  5. margin:auto;
  6. padding:20px;
  7. }
  8. .pngfix {
  9. float:left;
  10. width:16px;
  11. height:16px;
  12. }
  13. .cross {
  14. background:url(cross.png) no-repeat; /* ff */
  15. _background:#666; /* IE6 only */
  16. filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='cross.png', sizingMethod='image'); /* IE6 only */
  17. }
  18. .accept {
  19. background:url(accept.png) no-repeat; /* ff */
  20. _background:#666; /* IE6 only */
  21. filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='accept.png', sizingMethod='image'); /* IE6 only */
  22. }
  23.  
  24. <!--[if lte IE 6]&gt;<script type="text/javascript" src="pngfix.js"></script>&lt;![endif]-->
  25.  
  26.  
  27. <span class="pngfix cross"></span>
  28. <span class="pngfix accept"></span>
  29. <div><img></div>

点击这里可以查看效果。





This entry was posted in 技术研究 and tagged , . Bookmark the permalink.

15 Responses to 终于彻底解决了png的透明问题

  1. boyuan says:

    你好,pngfix.js文件在哪里?

  2. 心情舒畅,先送杯热茶给楼主,慢慢享用,别客气

  3. 已经达到了忘我的境界了呵呵。

  4. 泡妞 says:

    泡妞技巧来我博客看看

  5. 盖特威 says:

    你这文章很丰富,大家一定要转告转告。

  6. 北山 says:

    来做沙发了。

  7. 小朋 says:

    博主模板很漂亮!

  8. 减肥吧 says:

    2009年度淘宝最畅销减肥产品,销量排名

  9. 代写 says:

    路过,博客不错!

  10. 2010排行榜恭祝你的博客越办越好,TOP上榜,好运滚滚来

  11. 捡吧 says:

    来我的捡吧看看吧。看能捡到什么吧

  12. 侠盗 says:

    文章不错,模板也挺不错的。

  13. 流量计 says:

    写的不错,支持,顶一下

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

以新浪微博帐号登录