title: I want the side bar display first and collapse after clicking the button and adding the dropdown to the side of the menu items using bootstrap
body: <p>I want the side bar menu using <code>bootstrap</code>.</p>
  
  <p>I want to hide the menu even in the large screen by clicking the button.</p>
  
  <p>When collpasing to the left side menu icons should display on the left side. </p>
  
  <p>Inside the menu item by clicking it dropdown to the side.</p>
  
  <p>Please tell me the solution.</p>
  
  <p>I tried using the <code>css</code> and <code>bootstrap</code> and <code>jquery</code>. It is not working.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#wrapper {
    padding-left: 250px;
    transition: all 0.4s ease 0s;
  }
  
  #sidebar-wrapper {
    margin-left: -250px;
    top: 51px;
    left: 250px;
    width: 250px;
    background: #000;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.4s ease 0s;
  }
  
  #wrapper.active {
    padding-left: 0;
  }
  
  #wrapper.active #sidebar-wrapper {
    left: 0;
  }
  
  #page-content-wrapper {
    width: 100%;
    padding-top: 70px;
    transition: all 0.4s ease 0s;
  }
  
  .sidebar-nav {
    position: absolute;
    top: 0;
    width: 250px;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  .sidebar-nav li {
    line-height: 40px;
    text-indent: 20px;
  }
  
  .sidebar-nav li a {
    color: #999999;
    display: block;
    text-decoration: none;
    padding-left: 60px;
  }
  
  .sidebar-nav li a span:before {
    position: absolute;
    left: 0;
    color: #41484c;
    text-align: center;
    width: 20px;
    line-height: 18px;
  }
  
  .sidebar-nav li a:hover,
  .sidebar-nav li.active {
    color: #fff;
    background: rgba(255,255,255,0.2);
    text-decoration: none;
  }
  
  .sidebar-nav li a:active,
  .sidebar-nav li a:focus {
    text-decoration: none;
  }
  
  .sidebar-nav &gt; .sidebar-brand {
    height: 65px;
    line-height: 60px;
    font-size: 18px;
  }
  
  .sidebar-nav &gt; .sidebar-brand a {
    color: #999999;
  }
  
  .sidebar-nav &gt; .sidebar-brand a:hover {
    color: #fff;
    background: none;
  }
  
  #menu-toggle {
    text-decoration: none;
    float: left;
    color: #fff;
    padding-right: 15px;
  }
  
  @media (max-width:767px) {
    #wrapper {
      padding-left: 0;
    }
  
    #sidebar-wrapper {
      left: 0;
    }
  
    #wrapper.active {
      position: relative;
      left: 250px;
    }
  
    #wrapper.active #sidebar-wrapper {
      left: 250px;
      width: 250px;
      transition: all 0.4s ease 0s;
    }
  
    #menu-toggle {
      display: inline-block;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="wrapper"&gt;
    &lt;nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"&gt;
      &lt;div class="container-fluid"&gt;
        &lt;div class="navbar-header"&gt;
          &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
            aria-expanded="false" aria-controls="navbar"&gt;
            &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;/button&gt;
          &lt;div class="navbar-brand"&gt;
            &lt;a id="menu-toggle" href="#" class="glyphicon glyphicon-align-justify btn-menu toggle"&gt;
              &lt;i class="fa fa-bars"&gt;&lt;/i&gt;
            &lt;/a&gt;
            &lt;a href="#"&gt;Project name&lt;/a&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div id="navbar" class="collapse navbar-collapse"&gt;
          &lt;ul class="nav navbar-nav"&gt;
            &lt;li class="active"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="#about"&gt;About&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/div&gt;
        &lt;!--/.nav-collapse --&gt;
      &lt;/div&gt;
    &lt;/nav&gt;
    &lt;!-- Sidebar --&gt;
    &lt;div id="sidebar-wrapper"&gt;
      &lt;nav id="spy"&gt;
        &lt;ul class="sidebar-nav nav"&gt;
          &lt;li class="sidebar-brand"&gt;
            &lt;a href="#home"&gt;&lt;span class="fa fa-home solo"&gt;Home&lt;/span&gt;&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;a href="#anch1"&gt;
              &lt;span class="fa fa-anchor solo"&gt;Anchor 1&lt;/span&gt;
            &lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;a href="#anch2"&gt;
              &lt;span class="fa fa-anchor solo"&gt;Anchor 2&lt;/span&gt;
            &lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;a href="#anch3"&gt;
              &lt;span class="fa fa-anchor solo"&gt;Anchor 3&lt;/span&gt;
            &lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;a href="#anch4"&gt;
              &lt;span class="fa fa-anchor solo"&gt;Anchor 4&lt;/span&gt;
            &lt;/a&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/nav&gt;
    &lt;/div&gt;
    &lt;!-- Page content --&gt;
    &lt;div id="page-content-wrapper"&gt;
      &lt;div class="page-content"&gt;
        &lt;div class="container-fluid"&gt;
          &lt;div class="row"&gt;
            &lt;div class="col-md-6"&gt;
              &lt;div class="panel panel-danger"&gt;
                &lt;div class="panel-heading"&gt;
                  Panel 1
                &lt;/div&gt;
                &lt;div class="panel-body"&gt;
                  content body
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="col-md-6"&gt;
              &lt;div class="panel panel-success"&gt;
                &lt;div class="panel-heading"&gt;
                  Panel 1
                &lt;/div&gt;
                &lt;div class="panel-body"&gt;
                  content body
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>