为什么不在移动设备上改变boostrap列的顺序?

时间:2018-03-24 07:56:12

标签: html twitter-bootstrap bootstrap-4

我在bootstrap中有一个div命令:

在我想要的普通电脑上:

first  second third

但在手机上我想:

third
second
first

我已经检查了引导网格系统页面并提出了这个:

   <!doctype html>
    <html lang="en">
      <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

        <!-- Bootstrap CSS -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

        <title>Hello, world!</title>
      </head>
      <body>

        <div class="container">
      <div class="row">
        <div class="col order-md-1 order-sm-3 order-xs-3">
          First,
        </div>
        <div class="col order-md-2 order-sm-2 order-xs-2">
          Second,
        </div>
        <div class="col order-md-3 order-sm-1 order-xs-1">
          Third,
        </div>
      </div>
    </div>

        <!-- Optional JavaScript -->
        <!-- jQuery first, then Popper.js, then Bootstrap JS -->
        <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
      </body>
    </html>

在移动设备上我一直显示:

first
second
third

谁能告诉我我做错了什么?

1 个答案:

答案 0 :(得分:1)

这就是您需要重新订购的全部内容。 -xs-中缀已被删除,您只需要最小和中等的订单。

https://www.codeply.com/go/mNZVT7Vpng

<div class="container">
    <div class="row">
        <div class="col order-md-1 order-3">
            First,
        </div>
        <div class="col order-2">
            Second,
        </div>
        <div class="col order-md-3 order-1">
            Third,
        </div>
    </div>
</div>

A-B-C至C-B-A