Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么我的css3的“多背景”功能实现不起作用?_Html_Css - Fatal编程技术网

Html 为什么我的css3的“多背景”功能实现不起作用?

Html 为什么我的css3的“多背景”功能实现不起作用?,html,css,Html,Css,我看到了这篇文章:我尝试将噪声图像添加到背景图像中,以便噪声与背景重叠。 这是我的css代码: body { background: url(../img/bg.jpg) no-repeat center center fixed, url(../img/bgnoise_lg_dark.png) repeat scroll; background-size: cover; } 但实际上只有背景图像显示,没有噪声。 我的错误是什么?我认为您需要交换图像顺序。最上面的一层走在前面,

我看到了这篇文章:我尝试将噪声图像添加到背景图像中,以便噪声与背景重叠。 这是我的css代码:

body {
    background: url(../img/bg.jpg) no-repeat center center fixed, url(../img/bgnoise_lg_dark.png) repeat scroll;
    background-size: cover;
}
但实际上只有背景图像显示,没有噪声。
我的错误是什么?

我认为您需要交换图像顺序。最上面的一层走在前面,最下面的一层走在最后。我猜你的背景图像层正在覆盖你的噪声层

body {
    background: url(../img/bgnoise_lg_dark.png) repeat scroll, url(../img/bg.jpg) no-repeat center center fixed;
    background-size: cover;
}

嗯,好的,现在是顶部的噪音,但噪音不是透明的,它应该是,并延伸到整个屏幕:/不确定。您可以尝试拆分这些值:即使背景图像、背景重复和背景位置分开。这两种方法都应该有效,但你可能会发现有其他方法可以尝试。