2014-10-10 146 views
1

我需要在我的网站使用一个静态的不重复的背景图像后,但是当图像完成(垂直),我需要反复使用其他图片。这怎么能做到?CSS重复的背景图像的背景图像完成

对于第一形象应该是这样的:

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; 

怎么能这样做?

问候,

回答

2

使用相同的元素多背景(调整大小,以您的需求):

background: 
    url(bg1.png) 500px 100px no-repeat, 
    url(bg2.png) 50px 100px repeat; 
+0

良好的解决方案,但IE8不支持多背景 – 4EACH 2014-10-10 11:56:38