2012-11-08 163 views
0

我需要一个半满页背景图像div(如Twitter的主页)。 其实我,试图:Div与背景覆盖

`background: url(images/bg.png) no-repeat center center fixed; 
-webkit-background-size: cover; 
-moz-background-size: cover; 
-o-background-size: cover; 
background-size: cover;` 

,但我需要空间的头,像150-200px高度。 我该如何解决它? 我不希望这个div在标题后面,我希望它从它下来。 谢谢

回答

0

看看移动背景图像帮助你! How to shift a background image with css

否则,我会有一个div后的标题,并把背景图像在那里。所以你的HTML代码看起来像这样...

<h1>Hi, this is a header!</h1> 
<div class="backgroundPlz"></div>