是否可以不使用 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.
关于html - 将背景图像与 rgba 组合但没有渐变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30670449/