当前位置: 动力学知识库 > 问答 > 编程问答 >

html - ie6 Showing Image(.PNG) background-color for a transparent background

问题描述:

Hi guys I have a problem of images showing background-color on IE6 and its supposed to be a transparent background. on all the other browsers it is showing fine except for IE6.

can anyone please tell me what am i doing wrong. tried the opacity to 0 but its still showing the background-color.

网友答案:

The fix is quite simple. No need to include any JavaScript. Define your css like this and include your image name in filter.

.whatever {
    background: none; /* Hide the current background image so you can replace it with the filter*/
    width: 500px; /* Must specify width */
    height: 176px; /* Must specify height */
    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='vehicles.png');
}
网友答案:

IE6 doesn't support semi-transparent PNGs. Try something like this for a work-around if you really need to:

http://css-tricks.com/snippets/css/png-hack-for-ie-6/ or http://www.jay-han.com/2008/10/15/unit-png-fix-best-ie-png-hack/

Or just drop IE6, it's way behind all other browsers, and fast losing market.

网友答案:

IE6 doesn't support transparent PNGs properly.

This page has a fix which involves a behaviour file. Alternatively you could use GIFs.

分享给朋友:
您可能感兴趣的文章:
随机阅读: