不错的IE6 PNG修复

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了不错的IE6 PNG修复相关的知识,希望对你有一定的参考价值。

There are several fixes out there that work in different ways, but none of them are perfect (especially regarding background images). Here's a list of the ones I've found that work reasonably well—try them out to find one that works for your web page.
  1. There are several IE PNG fixes out there that work in different ways, but none of them are perfect (especially regarding background images). Here's a list of the ones I've found that work reasonably well--try them out to find one that works for your web page.
  2.  
  3. *********************************************************
  4. DD_belatedPNG
  5. http://www.dillerdesign.com/experiment/DD_belatedPNG/
  6.  
  7. Download the DD_belatedPNG javascript file
  8. Edit the selector in the call to fix()
  9.  
  10. *** In html: ***
  11.  
  12. <!--[if IE 6]>
  13. <script type="text/javascript" src="DD_belatedPNG_0.0.7a.js"></script>
  14. <script type="text/javascript">DD_belatedPNG.fix("img, div");</script>
  15. <![endif]-->
  16.  
  17.  
  18. *********************************************************
  19. IE PNG Alpha Fix
  20. http://www.twinhelix.com/css/iepngfix/
  21.  
  22. Download iepngfix.htc and blank.gif
  23. Edit the path to blank.gif in iepngfix.htc
  24. Edit the selector in the inline CSS
  25.  
  26. *** In HTML: ***
  27.  
  28. <!--[if IE 6]>
  29. <style type="text/css">
  30. img, div { behavior: url(iepngfix.htc) }
  31. </style>
  32. <![endif]-->
  33.  
  34.  
  35. *********************************************************
  36. IE PNG FIX. CSS Solution
  37. http://snipplr.com/view/4637ie-png-fix-css-solution/
  38. This is basically the same as above, but put directly into the stylesheet instead of an .htc file
  39.  
  40. Download transparent.gif
  41. Edit the selector in the inline CSS
  42.  
  43. *** In HTML: ***
  44.  
  45. <!--[if IE 6]>
  46. <style type="text/css">
  47. img, div {
  48. azimuth: expression(
  49. this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
  50. this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",
  51. this.src = "/images/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
  52. this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",
  53. this.runtimeStyle.backgroundImage = "none")),this.pngSet=true
  54.  
  55. );
  56. }
  57. </style>
  58. <![endif]-->

以上是关于不错的IE6 PNG修复的主要内容,如果未能解决你的问题,请参考以下文章

css IE6的透明PNG修复

CSS 超级ie6 png修复

CSS ie6的图像标签png修复

JavaScript 修复IE6 PNG alpha

IE6 PNG透明度修复与背景定位

ie6的图像标签png修复