带有推/拉和列的列

时间:2019-06-26 08:39:56

标签: html css sass bootstrap-4

在桌面视图中,它们应显示为: col 1 col 2          | 3 在莫比 第 1 行 第 2 行     col 3

我想要在移动视图中显示如下: 第 2 行 行col 1 | 3

我当前的代码:

<div class="row">
  <div class="col-12 col-lg-7">
    **1**
  </div>
  <div class="col-12 col-lg-5">
    <div class="row my-5">
      <div class="col-12">
        **2**
      </div>
    </div>
    <div class="row">
      <div class="col-12">
        **3**
      </div>
    </div>
  </div>
</div>

1 个答案:

答案 0 :(得分:0)

您可以按照要求order-sm-**

来订购专栏

<!DOCTYPE html>
<html lang="en">

<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>

<body>

   <div class="container-fluid">

    <div class="row">
        <div class="col-8 order-sm-11">column 2</div>
        <div class="col-8 order-sm-1"> column 1</div>
        <div class="col-4 order-sm-11">column 3</div>

    </div>
</div>
</body>

</html>