PNG24 in transparent format will be replaced by Gray in the IE6 transparent section.
So, what is the way to solve this bug?
Workaround:
① pictures in PNG8 format instead of PNG24 format
Using fireworks to export the alpha-mode PNG8 format picture, the alpha-mode PNG8 format Picture supports translucent, fully transparent and translucent portions of the IE6 are displayed for full transparency and have jagged edges. If the impact on the user experience is not very large, you can consider using this method.
②CSS Filter
Add code to the selector with the transparent PNG picture applied:
_background:transparent;
_filter:progid:dximagetransform.microsoft.alphaimageloader (src= ' img/nav.png ', sizingmethod= ' scale ');
Disadvantages of this approach:
(a) The PNG transparent picture in the page is invalid only if the background picture is transparent;
(b) The background picture can not be tiled, can only stretch;
(c) causes links and buttons in the area to be invalidated;
Workaround: Add a link or button outside the area, then overlay the area with margin, or use position to locate the implementation.
③jquery png fix plug-in
relative to the previous method, JQuery's IE6 png Transparent plug-in is relatively strong. Plug-in jquery.pngFix.js download and the use of specific methods.
because the address is in English, here is a simple translation of it.
Add within head:
<!--[if IE 6]>
<script type= "text/web Effects" src= "Jquery.js" ></SCRIPT>//JQ Library, Download your own
<script type= "Text/javascript" src= "jquery.pngFix.js" ></script>//Note path
<script type= " Text/javascript ">
$ (document). Ready (function () {
$ (document). PngFix ();
});
</script>
can also be targeted at a specific selector:
<script type= "Text/javascript"
$ (document). Ready (function () {
$ ('. png '). PngFix ();//.png converted to a selector with a transparent PNG picture
});
</script>
<![ endif]-->
Disadvantage: backgrond-position and background-repeat are not supported.
④dd_belatedpng Plugin
Dd_belatedpng supports Backgrond-position and background-repeat, while Dd_belatedpng also supports a:hover properties, as well as .
The plugin uses Microsoft's VML language for rendering, while most other solutions to PNG problems are AlphaImageLoader filters, plug-in dd_belatedpng download addresses, and specific usage methods.
Use method translation:
<!--[if IE 6]>
<script src= "Dd_belatedpng.js" mce_src= "Dd_belatedpng.js" ></script>
<script type= "Text/javascript" >
Dd_belatedpng.fix ('. png '); PNG converted to a selector with a transparent PNG picture
</script>
<! [endif]-->