中间的空隙?

时间:2014-10-06 12:03:27

标签: twitter-bootstrap twitter-bootstrap-3

在Bootstrap中,当我需要中间的间隙时,我需要做什么。

内容容器为col-md-6,图片容器为col-md-5

例如:

enter image description here

应该是这样的:

    <div class="info-container">
        <div class="col-md-6">
          <h2>Lorem ipsum dolor sit amet</h2>
          <p>Quisque ut nulla enim. Nullam placerat metus risus, quis scelerisque felis pretium tristique. Vivamus mi tellus, lacinia at rutrum quis</p>
        </div> 
        <div  class="col-md-5">           
            <img src="img/image.jpg" alt ="">  
        </div>
    </div>

1 个答案:

答案 0 :(得分:3)

要使用col-md-offset-1包含您需要填补列的间隙,如下所示:

&#13;
&#13;
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>


<div class="info-container">
  <div class="col-md-6">
    <h2>Lorem ipsum dolor sit amet</h2>
    <p>Quisque ut nulla enim. Nullam placerat metus risus, quis scelerisque felis pretium tristique. Vivamus mi tellus, lacinia at rutrum quis</p>
  </div>
  <div class="col-md-offset-1 col-md-5">
    <img src="http://placehold.it/350x150" alt="">
  </div>
</div>
&#13;
&#13;
&#13;