我想将背景图片拉伸到父级div的100%宽度和高度。当然,background-size在IE8中不受支持。我尝试了以下代码,但它不起作用。
.box:before {
background: url(images/body_background2.png) no-repeat;
display: block;
position: absolute;
z-index: -1;
height: 100%;
width: 100%;
content: '';
}
class=fullbackground
。 - Zetamin-width: {whatever-width-the-image-is}
,高度也是同理。 - John Ruddell