我有一个要求有一个带有背景图像的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中,有没有什么我可以在不更改标记的情况下,在背景图像上创建一个暗淡不透明的黑色图层?某种“过滤器”风格?
发布于 2010-09-09 13:32:05
不是的。你唯一的选择是ms-filter或者稍有不同的一个。
<!--[if IE]>
<style type="text/css">
.color-block {
background:transparent;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000050,endColorstr=#99000050);
zoom: 1;
}
</style>
<![endif]-->也可以看看这个:http://www.hedgerwow.com/360/dhtml/rgba/demo.html
发布于 2013-03-21 15:48:14
我有一个类似的问题,为了克服它,我习惯于在我的模式div上使用类,背景不透明等。另一个只是为了显示微调器。这条路线似乎适用于我测试过的所有当前浏览器。
.modal {
display: none;
position: fixed;
z-index: 1000;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: rgba(255,255,255, .8);
background-color: #fff;
opacity: 0.8;
filter: alpha(opacity=80);
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
}
.spinner{
z-index: 1010;
background-image: url(/_Layouts/Images/GEARS_AN.GIF);
background-position: 50% 50%;
background-repeat: no-repeat;
}https://stackoverflow.com/questions/3673849
复制相似问题