如何更改引导网格系统?

时间:2017-09-12 15:55:52

标签: twitter-bootstrap

当我有这样的事情时:

<div class="container">
  <div class="row">
    <div class="col-lg-6 col-md-6 col-sm-12">
      A
    </div>
    <div class="col-lg-6 col-md-6 col-sm-12">
      B
    </div>
  </div>
</div>

在小型设备(手机)B上将打破A. 有没有办法在不改变代码序列的情况下打破B下的A?

谢谢!

1 个答案:

答案 0 :(得分:0)

使用.col-sm-push-*.col-sm-pull-*类更改网格列的顺序:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

<div class="container">
  <div class="row">
    <div class="col-lg-6 col-md-6 col-sm-6 col-sm-push-6">A</div>
    <div class="col-lg-6 col-md-6 col-sm-6 col-sm-pull-6">B</div>
  </div>
</div>