我有一个圆角矩形的图像,我使用它的背景的顶部和底部通过使用:
#content_top { /* 760px by 30px */
background: #F7EECF url(images/content_top_bottom_bg.png) no-repeat 0 0 scroll;
height: 10px;
}
#content_bottom { /* 760px by 30px */
background: #F7EECF url(images/content_top_bottom_bg.png) no-repeat 0 -20px scroll;
height: 10px;
}
然后我使用另一个1px高度图像垂直重复填充之间的区域为这个div的背景。喜欢这个:
#content { /* 760px by 1px */
background: #F7EECF url(images/content_body.png) repeat-y 0 0 scroll;
}
现在我想知道是否可以只使用相同的图像(content_top_bottom.png),但只是其中的一部分,实现相同的效果?我试过这样的东西,但它没有工作:
#content { /* 760px by 1px */
background: #F7EECF url(images/content_top_bottom.png) repeat-y 0 -5px scroll;
}
我想使用同一个图像,因为我想减少http请求的数量。 1px的图像可能不会有很大的影响,但我只是想尝试。任何人都可以帮助?