[CSS]-Allow IE6 to support PNG-24 transparent background (multiple methods)

Source: Internet
Author: User
1. Use iepngfix

Example: http://www.twinhelix.com/css/iepngfix/demo/

: Http://www.twinhelix.com/css/iepngfix/

Advantages: the entire page can automatically process the transparent background of the PNG-24, do not have to do another picture instead of trouble.

Disadvantage: you cannot use too many pages. Otherwise, the page loading speed slows down significantly.

**************************************** **************************************** *****************

2. Apply the filter effect

Although not every browser can support filter, but just to solve the PNG-24 transparent background, it doesn't matter.

Source: youdaoSource code

 <  Style  >  
Body {
Background : Url(bg.gif) ;
}
. Test {
Width : 451px ;
Height : 42px ;
Background : Url(test.png) ;
_ Background : None ;
_ Filter : Progid: dximagetransform.microsoft.alphaimageloader(src+'test.png ', sizingmethod = 'crop ') ;
}
</ Style >
< Div Class = "Test" > </ Div >

Advantages:CodeSmall, simple.

Disadvantage: Use a filter on the image of the PNG-24 Image

**************************************** **************************************** *****************

3. Use a picture of the PNG-8 instead

Source: Network

PNG-8 is generally saved with PS :( in "file-> storage for Web and device format" Save, sometimes will use the "diffusion transparency imitation color ")

Advantage: you do not need to process it as mentioned above

Disadvantage: if there is a rounded corner, it will look a little right angle. If there is a gradient outside the image (including the shadow effect), it will easily make most of the color of the Shadow replaced by its hidden color, resulting in high distortion.

**************************************** **************************************** *****************

4. Use CSS hack

Can make the normal display of the PNG-24 is directly displayed, otherwise use CSS hack to replace other formats of pictures (such as JPG), this method is to see other people's source code to know, belong to the most helpless method.

Advantage: at least the image can be displayed normally.

Disadvantage: the website has many files, which occupies a large space and is inconvenient to modify.

**************************************** **************************************** *****************

PS: PNG-8 and GIF transparent background can make IE6 direct display, but compared with the PNG-24, the picture distortion is too outrageous

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.