折叠侧边栏后,将三个项目行放入四个项目行

时间:2017-11-13 14:02:06

标签: html bootstrap-4

如果您看一下演示,您会在一行中看到一堆卡片。但是一行中应该只有三张卡,如果你点击“折叠边栏”,它应该每行更改四张卡。

即使你,卡片也应固定,不要太宽 重新使用更大的屏幕。 我知道,该演示目前所有的卡都在一行中。

非常感谢! :)

<!DOCTYPE html>
<html>

<head>
  <title>TEST</title>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
</head>

<body>
  <div class="container-fluid h-100">
    <div class="button--sidebarCollapse">
      <a class="button--collapse" data-toggle="collapse" href="#collapseExample" aria-expanded="true" aria-controls="collapseExample"> >COLLAPSE SIDEBAR</a>
    </div>
    <div class="row h-100">
      <!-- SIDEBAR FILTER CONTENT -->
      <div class="col-2 collapse show form--sidebarContents" id="collapseExample">
        <div class="p-2">
          <form class="form-row my-2 my-lg-0 form--search">
            <p>lorem ipsum placeholder</p>
          </form>
        </div>
      </div>
      <div class="col h-100 cards--mainContent">
        <div class="row">
          <div class="card-deck">
            <div class="card" data-toggle="collapsed" aria-expanded="false" id="sidebar" data-target="sidebar">
              <img class="card-img-top" src="..." alt="Card image cap">
              <div class="card-body">
                <h4 class="card-title">Card title</h4>
                <p class="card-text">little bit longer.</p>
              </div>
            </div>
            <div class="card">
              <img class="card-img-top" src="..." alt="Card image cap">
              <div class="card-body">
                <h4 class="card-title">Card title</h4>
                <p class="card-text"> is a little bit longer.</p>
              </div>
            </div>
            <div class="card">
              <img class="card-img-top" src="..." alt="Card image cap">
              <div class="card-body">
                <h4 class="card-title">Card title</h4>
                <p class="card-text">This content is a little bit longer.</p>
              </div>
            </div>
            <div class="card">
              <img class="card-img-top" src="..." alt="Card image cap">
              <div class="card-body">
                <h4 class="card-title">Card title</h4>
                <p class="card-text">This is a</p>
              </div>
            </div>
            <div class="card">
              <img class="card-img-top" src="..." alt="Card image cap">
              <div class="card-body">
                <h4 class="card-title">Card title</h4>
                <p class="card-text">Th a little bit longer.</p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  
  <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.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
</body>

</html>

0 个答案:

没有答案