So, i have just a simple navbar with Bootstrap :
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">LOGO</a>
</div>
<div>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Menu <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Messages</a></li>
<li><a href="#">Paramètres</a></li>
<li><a href="#">Mes frenks</a></li>
<li class="divider"></li>
<li><a href="#">Signaler un bug</a></li>
<li><a href="#">Conditions générales</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-right" role="form">
<div class="form-group">
<input class="form-control" type="text" placeholder="Recherche">
</div>
</form>
</div><!--/.nav-collapse -->
</div>
</div>
Check fiddle : jsfiddle
I do not want that when you change the size of the window, the navbar is divided into multiple lines. In my example, the dropdown menu and input is placed below.
I want the navbar is just crushed up, staying on the same line .. any idea?
Simply add .navbar-expand
class to your navbar, and it will never collapse.
Navbars can utilize
.navbar-toggler
,.navbar-collapse
, and.navbar-expand{-sm|-md|-lg|-xl}
classes to change when their content collapses behind a button. In combination with other utilities, you can easily choose when to show or hide particular elements.For navbars that never collapse, add the
.navbar-expand
class on the navbar. For navbars that always collapse, don’t add any.navbar-expand
class.
from https://getbootstrap.com/docs/4.1/components/navbar/#responsive-behaviors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With