2012-05-23 39 views
0

我有一个网页,我有hr标签来分隔页面中的部分。 我正在使用css将图像作为背景应用于hr标签。 hr标签的宽度为100%,但图像不占用整个标签。 如何强制图片占据hr标签占用的整个区域。 是否有可伸展象端至端伸展背景图像设置为hr标记

小时 {

background: url("images/new/edge-top.png") no-repeat scroll 0 0 transparent; 
color: transparent; 
height: 10px; 
margin: 0 auto; 
width: auto; 
clear: both; 
border: 0 none; 
display: block; 
padding: 0px; 

}

检查得到的图像这里的任何延伸性:

enter image description here

回答

2

CSS3有一些新的选择。尝试

background-size: x% x%; 

在这里,您可以为新的后台模块读取the Spec

但是,请注意,这是非常差supported在IE浏览器! (有人惊讶吗?)