2010-10-12 62 views

回答

2

只能在CSS3中使用background-size。您还可以使用-o-background-size,-webkit-background-size-moz-background-size尝试并最大化浏览器支持。您应该将该值设置为100%。在其他浏览器中,您可以重复背景或在图像不足时使用颜色,但不能拉伸。在下面的第一个链接中有建议尝试和伪造它。

请参见:

0

您可以将它固定为一层做没有CSS3。

<img src="background.png" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; position:absolute; z-index:-1;" /> 
<div style="position: static;z-index: 1; "> 
    content 
</div>