2012-09-20 187 views
2

我需要在屏幕上拉伸背景图像,并适合在此网站上调整大小时http://ether.tomasbeloch.cz,有人知道吗?CSS背景图像拉伸与背景图像属性

<body> 
    <div id="background"></div> 
    ... 
    </div> 
</body> 

CSS文件:

html, body { } 
body { height:100%; width: 100%; } 
#background{ position: fixed; min-height: 1024px; height:100%; min-width: 100%; width: auto; background-repeat: no-repeat; z-index:1 } 

预先感谢您

+0

你为什么不使用'背景 - '身体'上的图像? – Ana

回答

2

你会找到你需要的一切在这里: http://css-tricks.com/perfect-full-page-background-image/

+0

@TomášBěloch - [这是另一个很好的来源。](http://css-tricks.com/how-to-resizeable-background-image/) – Aust

+0

你引用的来源不考虑高度... –

+1

嗯,我确实说过很好的来源,不是很好。 ;) – Aust