Twitter bootstrap 引导mt auto不对齐底部

Twitter bootstrap 引导mt auto不对齐底部,twitter-bootstrap,alignment,margin,Twitter Bootstrap,Alignment,Margin,我有一个侧栏,您可以在HTML中看到。 我想对齐底部的User01和注销项目 我已将mt auto类分配给ul项,但它不起作用。 然后我用类mt auto创建了另一个分区,但是也没有帮助,你知道如何在引导过程中将它们对齐吗 在align item end中使用d-flex是否更好 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name=

我有一个侧栏,您可以在HTML中看到。
我想对齐底部的User01注销项目

我已将mt auto类分配给ul项,但它不起作用。
然后我用类mt auto创建了另一个分区,但是也没有帮助,你知道如何在引导过程中将它们对齐吗

在align item end中使用d-flex是否更好

<!DOCTYPE html>
<html lang="en">    
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css"
    integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
    integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
  <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">

  <link rel="stylesheet" href="css/style.css">
  <title>Control Panel</title>
</head>

<body>

  <div class="container m-0 p-0">
    <div class="row p-0">
      <div class="sidebar col-lg-2 col-md-3 col-sm-4 d-block bg-secondary px-4 pt-3 bg-dark text-light">        
        <div class="d-flex align-items-start flex-column">
          <a href="index.html" class="navbar-brand text-white mb-3"> <div class="d-inline">Admin Panel</div></a>

          <ul class="navbar-nav text-white">
            <li class="nav-item">
              <a href="index.html" class="nav-link text-white active">Dashboard</a>
            </li>
            <li class="nav-item">
              <a href="tasks.html" class="nav-link text-white">Tasks</a>
            </li>
            <li class="nav-item">
              <a href="categories.html" class="nav-link text-white">Categories</a>
            </li>
            <li class="nav-item">
              <a href="users.html" class="nav-link text-white">Users</a>
            </li>
          </ul>
          <div class="mt-auto">
          <ul class="navbar-nav text-white">
            <li class="nav-item dropdown">
              <a href="" class="nav-link dropdown-toggle text-white" data-toggle="dropdown">
                <i class="fas fa-user"></i> User01
              </a>
              <div class="dropdown-menu">
                <a href="profile.html" class="dropdown-item"><i class="fas fa-user-circle"></i> Profile</a>
                <a href="settings.html" class="dropdown-item"><i class="fas fa-cog"></i> Settings</a>
              </div>
            </li>
            <li class="nav-item">
              <a href="login.html" class="nav-link text-white">
                <i class="fas fa-sign-out-alt"></i> Logout
              </a>
            </li>            
          </ul>
        </div>

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

</html>

控制面板

position absolute
h-100
类添加到侧边栏,然后将
mt auto
更改为
position absolute
,并给出align stlye
style=“bottom:0”
。 您也可以为布局应用程序使用flex is smart align单向对齐方法


控制面板