这只是一个简单的bootstrap 4导航栏,但由于某些原因,我无法解释为什么我的导航链接不会排队。
<nav class="navbar navbar-light navbar-expand-sm bg-light navbar-laravel">
<a class="navbar-brand" href="#">
<img src="/images/logo.png" width="80" height="40" class="d-inline-block align-top" alt="">
<span class="ml-1">Risk management</span>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
</ul>
</div>
</a>
</nav>
有人知道吗?
答案 0 :(得分:0)
解决了。这是代码。
<nav class="navbar navbar-expand-sm navbar-light bg-light">
<img src="/images/logo.png" width="80" height="40" class="d-inline-block align-top" alt="">
<span class="ml-1">Risk Management</span>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link ml-2" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</nav>