2014-09-28 52 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>