IE6 PNG transparency

前端 未结 12 2148
耶瑟儿~
耶瑟儿~ 2020-11-28 08:26

How can I fix PNG transparency bug in IE6 for background image?

12条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 08:45

    1.Add conditional css for IE6 inside the head block of your document:

    2.Assign class name in your element:

    
    
    

    3.In ie6.css, apply filter. You have to specify width and height. Set background image to clear.cache.gif, the filter doesn't work without those properties:

    
    .yourClassName{
        width:8px;
        height:22px;
        background: url("locationOfBlankImage/clear.cache.gif");
        filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='filePath/imageName.png', sizingMethod='scale');
    }
    

提交回复
热议问题