2012-09-20 186 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