Bootstrap:在导航栏中对齐导航

时间:2018-03-04 09:43:58

标签: html css twitter-bootstrap

我想用Bootstrap v4创建一个导航器,但我很努力,因为它不像我期望的那样工作。导航应该包括两个导航,一个在左边,一个在右边。但是,两者都在左边。

据我了解Bootstrap文档,这应该有效。但事实并非如此。我的错误在哪里?

我正在使用justify-content-end类,应该没问题,对吧?

The second part of the nav should be on the right.

<nav class="nav">

/* This should be on the left side */
<ul class="nav justify-content-start">
  <li class="nav-item">
    <a class="nav-link active" href="#">Active</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="#">Link</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="#">Link</a>
  </li>
  <li class="nav-item">
    <a class="nav-link disabled" href="#">Disabled</a>
  </li>
</ul>

/* This should be on the right side */
<ul class="nav justify-content-end">
  <li class="nav-item">
    <a class="nav-link active" href="#">Active</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="#">Link</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="#">Link</a>
  </li>
  <li class="nav-item">
    <a class="nav-link disabled" href="#">Disabled</a>
  </li>
</ul>

</nav>

0 个答案:

没有答案