While using Bootstrap to create a navbar and resizing the browser window to a smaller width, you may notice that the menu items wrap onto multiple lines:
How can we prevent the menu items from wrapping and keep them on a single line? (the buttons/search field should stack above the brand logo, potentially hiding the brand)
Below is the code for the navbar:
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Brand</a>
</div>
<div>
<ul class="nav navbar-nav navbar-right">
<li class="navbar-form">
<div class="form-group">
<div class="input-group input-group-sm">
<input class="form-control" placeholder="Search" type="text">
<span class="input-group-btn">
<button class="btn btn-default" type="button"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
</span>
</div>
</div></li>
<li><a type="button" class="btn btn-default btn-sm" href="http://gget.it/ornlbhjq/edit.php" id="newpost">New post</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown" role="button" aria-expanded="false" id="dropdown">Login / Signup <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>