1
Your answer is in the documentation!
To
navbars
that never collapse, add the class.navbar-expand
on the navigation bar. Tonavbars
that always collapse, add no class.navbar-expand
.
https://getbootstrap.com/docs/4.0/components/navbar/#Responsive-Behaviors
Here’s an example working. This Navbar will always be "open" it will never collect the Links inside that button
<link rel="stylesheet" type="text/css" media="screen" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" />
<nav class="navbar navbar-expand navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<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" 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>
Hello friend, thank you. Upon seeing your reply, I went to see my code. It was like this: navbar-expand-lg. When removing the "-lg", it went all right. Thank you.
– ShBr
@Shbr that right there, this LG means that below screens Large he collapses the navbar :) [s
– hugocsl