如何创建这些Bootstrap列?

时间:2016-05-15 07:03:31

标签: html twitter-bootstrap-3 col

如何创建Bootstrap列,例如下面附带的照片?红线的大小是一样的吗?

enter image description here

1 个答案:

答案 0 :(得分:0)

阅读BS文档中的Nesting columns。另请阅读Responsive column resets

更直接地回答您的问题 - 这就是您所需要的:

<div class="container">
  <div class="row">
    <div class="col-sm-4">
      1.1
    </div>
    <div class="col-sm-4">
      1.2
    </div>
    <div class="col-sm-4">
      1.3
    </div>
    <div class="clearfix"></div>
    <div class="col-sm-8">
      2.1
    </div>
    <div class="col-sm-4">
      <div class="row">
        <div class="col-sm-12">
          2.2T
        </div>
        <div class="col-sm-12">
          2.2B
        </div>
      </div>
    </div>
    <div class="clearfix"></div>
    <div class="col-sm-4">
      3.1
    </div>
    <div class="col-sm-4">
      3.2
    </div>
    <div class="col-sm-4">
      3.3
    </div>
    <div class="clearfix"></div>
    <div class="col-sm-4">
      <div class="row">
        <div class="col-sm-12">
          4.1T
        </div>
        <div class="col-sm-12">
          4.1T
        </div>
      </div>
    </div>
    <div class="col-sm-8">
      4.2
    </div>
  </div>
</div>