gpt4 book ai didi

CSS:IE:样式版本 "background-color:rgba(...)"

转载 作者:行者123 更新时间:2023-12-02 08:57:41 25 4
gpt4 key购买 nike

我需要一个带有背景图像的 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 中做些什么来在背景图像上创建一个暗淡不透明的黑色图层吗?一些“过滤”风格?

最佳答案

没有。您唯一的选择是 ms-filters 或稍有不同的选择。

<!--[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

关于CSS:IE:样式版本 "background-color:rgba(...)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3673849/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com