导航栏中的列表项未向右对齐

时间:2019-06-04 06:43:28

标签: css bootstrap-4 angular7

我正在创建一个新的角度项目,并从导航栏开始,但是使用此代码,“登录”按钮未向右对齐。

<div>
  <nav class="navbar navbar-expand-md bg-primary navbar-dark" >
    <ul class="navbar-nav">
      <span class="navbar-text" style="color: black">
        Niffler
      </span>
    </ul>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <ul class="nav navbar-nav navbar-right">
      <li>
        <form class="form-inline">
          <input class="form-control mr-sm-2" type="text" 
             placeholder="Search...">
          <button class="btn btn-info" type="submit">Search</button>
        </form>
      </li>
      &nbsp;      
      <li>
        <button type="button" class="btn btn-primary" data- 
          toggle="modal" data-target="#myModal">
          Login
        </button>
      </li>      
    </ul>
  </nav>
</div>

1 个答案:

答案 0 :(得分:0)

您需要将navbar-toggler-right类添加到项目中