Solution IE6 Support Picture Translucent several methods

Source: Internet
Author: User

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]-->

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.