Bootstrap div元素和嵌套导航栏不占用100%的页面宽度

时间:2019-05-24 14:39:12

标签: html css bootstrap-4 navbar

我的导航栏和视口边缘之间似乎有一些空间。导航栏嵌套在容器流体的div中,我看不到任何填充或边距将在哪里发挥作用。

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="container-fluid">
  <!-- Nav -->
  <nav class="navbar bg-dark navbar-dark  navbar-expand-sm">
    <a class="navbar-brand" href="#">Generic</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
    <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
      <ul class="navbar-nav ml-auto">
        <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" href="#">Link</a>
        </li>
      </ul>
    </div>
  </nav>
</div>

1 个答案:

答案 0 :(得分:0)

您需要将$scope.msg的{​​{1}}设置为console.log