Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.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/35.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,我有以下背景图像: 我想将其用作div的背景,但要放置在div的底部,并且只从左到右平铺,而不是从上到下平铺。此外,我希望div的背景颜色为#e4e5e6,这样颜色可以显示透明块所在的位置 这是我的开始: HTML 但是,这种方法将图像居中,并且仍然从上到下平铺。它也无法显示背景颜色。尝试将所有与背景相关的属性放入一个声明中,如下所示: .tiles { width: 100%; height: 400px; background: #e4e5e6 url('tiles

我有以下背景图像:

我想将其用作div的背景,但要放置在div的底部,并且只从左到右平铺,而不是从上到下平铺。此外,我希望div的背景颜色为
#e4e5e6
,这样颜色可以显示透明块所在的位置

这是我的开始:

HTML


但是,这种方法将图像居中,并且仍然从上到下平铺。它也无法显示背景颜色。

尝试将所有与背景相关的属性放入一个声明中,如下所示:

.tiles {   
   width: 100%;
   height: 400px;
   background: #e4e5e6  url('tiles-bg.png') bottom left repeat-x;
 }

对于背景友好,您应该使用以下内容:

background: #e4e5e6 url('tiles-bg.png') bottom left fixed repeat-x;
你看,属性“background”-是通用的,当你使用background color,然后在background之后,关闭background color的属性

.tiles {   
   width: 100%;
   height: 400px;
   background: #e4e5e6  url('tiles-bg.png') bottom left repeat-x;
 }
background: #e4e5e6 url('tiles-bg.png') bottom left fixed repeat-x;