如果存在背景颜色,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?
任何人都知道如何解决这个问题?
Anybody know how to fix it?
推荐答案
看过 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-过滤器和缩放规则。
Apparently, there is no need for the -ms-filter and zoom rules.
这篇关于如果存在背景颜色,IE8渐变滤镜不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!