两个容器重叠

时间:2014-02-17 08:57:58

标签: twitter-bootstrap twitter-bootstrap-3

我在现有容器(背景图像集)之后创建了一个新容器。新添加的容器与旧容器重叠。我增加了填充顶部,效果很好。但是有必要为我们使用的所有容器类编写吗?请参阅图像(https://docs.google.com/file/d/0Bwyjk1QbhhGGXzRuMm4tcDhJeWc/edit)..       

<div class="row">
      <div class="col-lg-5 col-lg-offset-1   col-xs-5 col-xs-offset-1">
        <img src="images/logos-1.png" class="img-responsive"/>
      </div>    

      <div class="col-lg-5 col-lg-offset-1   col-xs-5 col-xs-offset-1">
        <img src="images/logos-2.png" class="img-responsive"/>
      </div>    
</div> <!--row-->
</div>

<!--SECOND CONTAINER-->

<div class="container has-bg1">

    <div class="row" >
        <div class="col-lg-4  col-xs-4">
            <img src="images/blueprint_logo1.png" class="img-responsive"/>
        </div>
        <div class="col-lg-4  col-xs-4" >
            <img src="images/blueprint_logo2.png" class="img-responsive"/>
        </div>
        <div class="col-lg-4  col-xs-4" >
            <img src="images/blueprint_logo3.png" class="img-responsive"/>
        </div>  
   </div><!--row-->

CSS:       .container.has-bg {       背景图像:网址(图像/ book_bg.png);       背景尺寸:封面;       }       .container.has-bg1 {       background-image:url(images / blueprint.png);       背景尺寸:封面;       }

1 个答案:

答案 0 :(得分:1)

你在容器内使用过.row吗?

<div class="container">
    <div class="row">
        <div class="col-lg-12">
        </div>
    </div>
</div>

每次都没有必要更换.container,你可以把所有东西放在一个容器里

<div class="container">

    <div class="row">
        <div class="col-lg-12">
            First row content
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            Second row content
        </div>
    </div>

</div>