Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap, remove responsive from navbar

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?

like image 850
Clément Andraud Avatar asked Feb 12 '14 20:02

Clément Andraud


1 Answers

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

like image 195
trondozer Avatar answered Oct 10 '22 20:10

trondozer