如何在bootstrap中计算推/拉顺序单元?

时间:2014-10-13 09:51:42

标签: css twitter-bootstrap twitter-bootstrap-3

我尝试命令像图像一样的单元格,这个引导程序代码是这样做的,但我仍然尝试&测试得到这个顺序,有没有办法计算网格中每个col的推或拉。

我的问题用另一种方式,我需要订购单元格,我可以打印像图像一样的单元格,我试试&测试拉/推的许多值以获得此代码..有计算值的方法吗?

<div class="row row-4">
    <div class="col-xs-3 col-md-push-9">5</div>
    <div class="col-xs-4 col-md-push-2">4</div>
    <div class="col-xs-1 col-md-pull-3">3</div>
    <div class="col-xs-3 col-md-pull-7">2</div>
    <div class="col-xs-1 col-md-pull-11">1</div>
</div>

enter image description here

1 个答案:

答案 0 :(得分:4)

考虑此代码和我们的12列:

<div class="row">
    <div class="col-xs-3">5</div>
    <div class="col-xs-4">4</div>
    <div class="col-xs-1">3</div>
    <div class="col-xs-3">2</div>
    <div class="col-xs-1">1</div>
</div>

我们得到了:

+---+-----------------+------------------+------------+---------+
| ° | Wanted position | Current position | Difference | Class   |
+---------------------+------------------+------------+---------|
| 1 | 1               | 12 (1+3+4+1+3)   | -11        | pull-11 |
| 2 | 2  (1+1)        | 9  (1+3+4+1)     | -7         | pull-7  |
| 3 | 5  (1+1+3)      | 8  (1+3+4)       | -3         | pull-3  |
| 4 | 6  (1+1+3+1)    | 4  (1+3)         | +2         | push-2  |
| 5 | 10 (1+1+3+1+4)  | 1                | +9         | push-9  |
+---+-----------------+------------------+------------+---------+

图片时间:

enter image description here