Bootstrap如何清除最后一个孩子的bootstrap列

时间:2017-05-18 10:40:58

标签: twitter-bootstrap multiple-columns

    <div class="row">
        <div class="testcontainer red  col-xs-6 col-sm-4 col-md-3">box 1</div>
        <div class="testcontainer green col-xs-6 col-sm-4 col-md-3">box 2</div>
        <div class="testcontainer blue col-xs-6 col-sm-4 col-md-3">box 3</div>
        <div class="testcontainer purple col-xs-6 col-sm-4 col-md-3">box 4</div>

    </div>

  <div class="row">
        <div class="testcontainer red  col-xs-6 col-sm-4 col-md-3">box 5</div>
        <div class="testcontainer green col-xs-6 col-sm-4 col-md-3">box 6</div>
        <div class="testcontainer blue col-xs-6 col-sm-4 col-md-3">box 7</div>
        <div class="testcontainer purple col-xs-6 col-sm-4 col-md-3">box 8</div>

    </div>

何时在平板电脑3列中显示如何清除最后一个孩子以移除正确的空间? view for tablet column

1 个答案:

答案 0 :(得分:0)

将所有列放在一行......

<div class="row">
        <div class="testcontainer red  col-xs-6 col-sm-4 col-md-3">box 1</div>
        <div class="testcontainer green col-xs-6 col-sm-4 col-md-3">box 2</div>
        <div class="testcontainer blue col-xs-6 col-sm-4 col-md-3">box 3</div>
        <div class="testcontainer purple col-xs-6 col-sm-4 col-md-3">box 4</div>
        <div class="testcontainer red  col-xs-6 col-sm-4 col-md-3">box 5</div>
        <div class="testcontainer green col-xs-6 col-sm-4 col-md-3">box 6</div>
        <div class="testcontainer blue col-xs-6 col-sm-4 col-md-3">box 7</div>
        <div class="testcontainer purple col-xs-6 col-sm-4 col-md-3">box 8</div>
</div>

类似的问题:How to change number of column in a row on resize - Bootstrap