san*_*eep 38
也许您应该使用:after或:before为此,因为不需要在HTML中添加额外的标记.像这样:
.container{
height:400px;
background:red;
position:relative;
width:400px;
}
.container:after{
content:"";
position:absolute;
top:20px;
left:0;
right:0;
bottom:0;
background:url(http://lorempixel.com/400/200) repeat-y;
}
Run Code Online (Sandbox Code Playgroud)
检查这个http://jsfiddle.net/h6K9z/
它适用于IE8及以上版本.对于IE7或IE6,您可以DIV为此提供额外的帮助.