使用空列在一个Bootstrap行类中添加多个12列行

时间:2017-04-27 12:03:24

标签: twitter-bootstrap twitter-bootstrap-3

我想在一个Bootstrap行类中添加多个12列行。但是通过使用空列(我称之为单元格),这不起作用。

代码:

<div class="row">
    <div class="col-md-1">
        <!-- no text -->
    </div>
    <div class="col-md-10">
        First row with this entry
    </div>
    <div class="col-md-1">
        <!-- no text -->
    </div>

    <div class="col-md-1">
        <!-- no text -->
    </div>
    <div class="col-md-10">
        Second row with this entry
    </div>
    <div class="col-md-1">
        <!-- no text -->
    </div>
</div>

但我不要使用例如像这里:

<div class="col-md-1">
    &nbsp;<!-- no text -->
</div>

1 个答案:

答案 0 :(得分:1)

对最左边的列使用col-md-offset-1 ...

<div class="row">
      <div class="col-md-10 col-md-offset-1">
          First row with this entry
      </div>
      <div class="col-md-1">
          <!-- no text -->
      </div>
      <div class="col-md-10 col-md-offset-1">
          Second row with this entry
      </div>
      <div class="col-md-1">
          <!-- no text -->
      </div>
</div>

http://bootply.com/uwoYHesTg7