我需要在我的网站上使用静态无重复背景图片,但当图片完成(垂直)时,我需要重复使用另一张图片。这是怎么做到的?
第一张图片应该是这样的:
background:url(../img/header/main_bg01.jpg) no-repeat top center;
但是对于第二个,在第一个之后的垂直方向,应该做一些类似的事情:
background:url(../img/header/main_bg02.jpg) repeat top center;
background-repeat: repeat-y;
这是怎么做到的?
问候,
最佳答案
在同一元素上使用多个背景(根据需要调整大小):
background:
url(bg1.png) 500px 100px no-repeat,
url(bg2.png) 50px 100px repeat;
关于CSS 在背景图像完成后重复背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26298748/