gpt4 book ai didi

html - 将背景图像与 rgba 组合但没有渐变

转载 作者:行者123 更新时间:2023-11-28 01:29:58 25 4
gpt4 key购买 nike

是否可以使用 rgba 渐变将背景图像与 rgba 颜色组合?

目前我的 css3 样式是这样的:

html
{
background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)),
url("../icons/sombrero.jpg")no-repeat center center fixed;
}

但我想象的是这样的:

html
{
background:rgba(0, 0, 0, 0.75),
url("../icons/sombrero.jpg")no-repeat center center fixed;
}

rgba 颜色应位于图像上方。我从 here 得到了渐变-'hack' .我在寻找渐变技术的替代方法,没有框阴影技巧。

最佳答案

将来可能会有。

来自 w3c 草案:

For example, one can use this as a simple way to "tint" a background image, by overlaying a partially-transparent color over the top of the other image:

background-image: image(rgba(0,0,255,.5)), url("bg-image.png"); 

background-color does not work for this, as the solid color it generates always lies beneath all the background images.

w3c documentation

关于html - 将背景图像与 rgba 组合但没有渐变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30670449/

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