CSS:IE:样式“background-color:rgba(...)”的版本
我需要一个带有背景图像的 div,并且该图像之上应该是不透明度为 0.7 的黑色层。
为此,我正在使用:
background-color:rgba(0, 0, 0, 0.7);
background-image:url(/Images/hash-000000-pattern.gif);
这在除 IE 之外的所有版本中都能完美运行。在 IE 6、7 和 8 中,不会渲染 background-color:rgba(0, 0, 0, 0.7);
。
在不更改标记的情况下,我可以在 CSS 中做些什么来在背景图像上创建一个暗淡不透明的黑色图层吗?某种“过滤”风格?
I have a requirement to have a div with a background image, and overtop that image should be a 0.7-opacity black layer.
For this, I'm using:
background-color:rgba(0, 0, 0, 0.7);
background-image:url(/Images/hash-000000-pattern.gif);
This works perfectly in everything but IE. In IE 6, 7, and 8, the background-color:rgba(0, 0, 0, 0.7);
isn't rendered.
Is there anything I can do in CSS without changing the markup to create a dimmed-opacity black layer over the background image? Some "filter" style?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不。您唯一的选择是 ms-filters 或稍有不同的选择。
也可以看看这个: http://www.hedgerwow.com/360/dhtml /rgba/demo.html
No. The only options you have are ms-filters or a slightly different one.
see this one too: http://www.hedgerwow.com/360/dhtml/rgba/demo.html
我遇到了类似的问题,为了解决这个问题,我曾经在模态 div 上进行类,其中一个用于背景不透明度等。另一个只是用于显示微调器。这条路线似乎适用于我测试过的所有当前浏览器。
I had a similar issue and to over come it I used to classes on my modal div one for the background opacity etc.. the other just to display the spinner. This route seems to work for all current browsers I've tested on.