Bootstrap 4: How to have a full width navbar with the content in a container (Like the SO Navbar)?
I was able to get the menu to 100% width
<ul class="navbar-nav nav-fill w-100">
<li class="nav-item">
<a href="#" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Contact</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">About</a>
</li>
</ul>
using nav-fill w-100 with Bootstrap 4
Wrap an element around the .container
element.
@import url( 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css' );
#primary-nav {
background-color: skyblue;
}
<div id="primary-nav">
<div class="container">
<ul class="nav">
<li class="nav-item">
<a href="#" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Contact</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">About</a>
</li>
</ul>
</div>
</div>
I had met this issue also. I solved by put the <nav>...</nav>
outside the <div class='container'>...</div>
or <div class='container-fluid'>...</div>
.