Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display Bootstrap's hamburger menu by default and place it on the left side

How might I display Bootstrap's collapsed, aka "Hamburger", menu by default but to have it on the left side of the browser?

I'm guessing that on the collapsed menu, I just change it to be as below?

<!-- the collapsing menu -->
    <div class="collapse navbar-collapse navbar-left" id="navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Contact</a></li>
      </ul>
    </div>
    <!--/.nav-collapse -->
like image 375
kirdua Avatar asked Jun 11 '15 15:06

kirdua


People also ask

Where should hamburger menu be?

If you're designing an Android app, you should follow Material Design guidelines. For left-to-right languages, hamburger menus should be placed at the top left corner of the screen. This means that the navigation drawer or side menu will also open from the left side of the screen. Navigation drawer on Android.

How do I open a burger menu?

Hamburger buttons are usually placed in the top corner of the user interface. When pressed, the button reveals a previously hidden menu (also called a “hamburger menu). This menu may “drop down” from the location of the button, appear as a modal, or slide in from the top, side, or bottom of the screen.


1 Answers

If you want to create a navbar with a three line "hamburger" on mobile devices, just follow the official Bootstrap template. If you want to move the button to the left, just add a float: left to the css or use the class "pull-left" on the button. Do note that you will need to add some margin: left to make sure there's some spacing between the button and the left border.

Bootply example here

like image 177
Martin Avatar answered Nov 15 '22 02:11

Martin