html - ie6 显示透明背景的图像 (.PNG) 背景颜色

标签 html css png transparency internet-explorer-6

大家好,我有一个图像在 IE6 上显示背景颜色的问题,它应该是透明背景。在所有其他浏览器上它都显示正常,除了 IE6。

谁能告诉我我做错了什么。尝试将不透明度设置为 0,但它仍然显示背景颜色。

最佳答案

修复非常简单。无需包含任何 JavaScript。像这样定义您的 css 并将您的图像名称包含在过滤器中。

.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');
}

关于html - ie6 显示透明背景的图像 (.PNG) 背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4989795/

相关文章:

html - 只打印一张表格 Html Css

html - 使用 css/javascript 进行图像 mask

ios - UIImage (UIGraphicsBeginImageContextWithOptions()) 创建速度比使用 PNG 初始化更快吗?

r - 使用 par mar 和 oma 增加 png 图中的边距不起作用

javascript - SASS 中的动态类名

javascript - 从 CKEditor 中的样式菜单设置默认样式

html - 带有徽章 : put icon right to the badge 的 Bootstrap 列表

java - 无法将当前 Canvas 数据转换为java中的图像

html - 垂直菜单 ul/li/a 中文本下的像素空间

CSS 布局帮助 - 将 div 拉伸(stretch)到页面底部