2014-09-28 49 views

回答

0

試試這個

<div class="col-lg-12" 
    style="padding:0px; background-image: url('http://www.kiteworldmag.com/media/wallpapers/2/187/3.jpg'); background-size: 100% auto; height:500px;;"> 
    <div class="col-lg-12" style="height:300px; padding:0px; margin:0px; display: block"> 
    </div> 
    <div class="col-lg-12" style="background-color:#ffffff; height:100px; padding:0px; margin:0px;"> 
    sdfsdf 
    </div> 
</div> 
1

使用本

 <div class="col-lg-12" style="background: url("../img/Bg.png"); background-size: 100% auto; height:100%;"> 
<div class="col-lg-12" style="hieght:500px; padding:0px; margin:0px;"> 
    </div> 
    <div class="col-lg-12" style="background-color:#ffffff; hieght:500px; padding:0px; margin:0px;"> 
    </div> 
    </div> 
+0

嗨Harutyun, 我覺得你的例子不適合我。 我想做這樣的事情http://www.hmsg.net/layout_example.jpg。我的問題是中間div,我不能把它垂直居中,並有100%的背景寬度。 – 2014-09-30 15:31:49

+0

我更改代碼請參閱並嘗試此操作 – 2014-09-30 16:05:19

0

感謝Harutyun,你的答案,

我用這個解決方案結束了:

<div style="margin:0; padding:0px; width:100%; height:100%; display:table"> 
    <div style="display: table-cell; vertical-align: middle;" > 
      <div style="background:#99FF33"> 
       <div class="container">Content Goes Here.</div> 
      </div> 
    </div> 
</div>