Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.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 在背景图像下重复背景色_Html_Css - Fatal编程技术网

Html 在背景图像下重复背景色

Html 在背景图像下重复背景色,html,css,Html,Css,我现在有一个特定高度和宽度的图像,我如何设置一个特定的颜色在图像下无限延伸 body { background-image: location; background-color: #fff; } 我希望背景颜色在背景图像下方,而不是整个页面,而是在它下面 使现代化 html有背景色:#红色 车身背景图像:.png图像和背景颜色:#fff 我希望背景色不要溢出html颜色,html颜色是顶部,只是溢出到正文的背景图像下方。使用以下代码: background:#ffffff u

我现在有一个特定高度和宽度的图像,我如何设置一个特定的颜色在图像下无限延伸

body {
    background-image: location;
    background-color: #fff;
}
我希望背景颜色在背景图像下方,而不是整个页面,而是在它下面

使现代化 html有背景色:#红色

车身背景图像:.png图像和背景颜色:#fff

我希望背景色不要溢出html颜色,html颜色是顶部,只是溢出到正文的背景图像下方。

使用以下代码:

background:#ffffff url(ImageUrl) no-repeat;
试试这个

background:red url(../img/s.jpg) no-repeat center top;

使用这一行代码

body{
    background:#ffffff url('img_tree.png') no-repeat right top;
}

img{背景色:#FF0000;}???如果是这么简单,我就不用问了。如果我这样做,背景色会覆盖整个页面,我需要它位于图像下方,而不是整个页面。如果img{background color:#FF0000;}使整个页面(正文)变红,那么您的图像相当大。。。你的问题也需要修改。您正在从谈论图像更改为背景图像。
body{
    background:#ffffff url('img_tree.png') no-repeat right top;
}