如果存在背景颜色,则 IE8 渐变过滤器不起作用 [英] IE8 gradient filter not working if a background color exists
问题描述
我正在尝试使用以下 CSS 样式.它们适用于大多数浏览器,包括 ie7.但是在 ie8 中,透明背景没有显示,而是我得到了我想设置为后备颜色的背景颜色.
I'm trying to use the following CSS styles. They are working on most browsers, including ie7. However in ie8, the transparent background does not show and instead I get the background color which I would like to leave set as a fallback color.
section.rgba{
background-color: #B4B490;
background-color: rgba(200, 0, 104, 0.4);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490')";
zoom: 1
}
我希望能够使其正常工作,而不必求助于将背景颜色设置为无的 IE 样式表.这可能吗?
I would like to be able to get this to work without having to resort to an IE stylesheet where i set the background color to none. Is this possible?
有人知道怎么解决吗?
推荐答案
在浏览了 CSS3please 之后我意识到我对我的 IE7/IE8 渐变样式做得太过分了.只需使用以下样式即可完成工作:
After glancing over at CSS3please I realized I was doing overkill with my IE7/IE8 gradient styles. Simply using the following style does the job:
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#444444', EndColorStr='#999999');
显然,不需要 -ms-filter 和缩放规则.
Apparently, there is no need for the -ms-filter and zoom rules.
这篇关于如果存在背景颜色,则 IE8 渐变过滤器不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!