Change Navbar breakpoint in Bootstrap 3.3.2 [duplicate]

Change Navbar breakpoint in Bootstrap 3.3.2 [duplicate]

This question already has an answer here:

Change bootstrap navbar collapse breakpoint without using LESS

16 answers

I’m putting together a rough navbar using Twitter bootstrap.

There’s a breakpoint at which the width of the device will cause the navbar items to collapse and show a menu button instead:

How can I change the breakpoint so the navbar collapses sooner? At the moment its able to break on to a new line when it comes up against the logo, which doesn’t look too great:

I’ve tried a fix detailed here, but it seemed to break the collapsed menu (couldn’t expand it again afterwards).
Here’s the html:

Solutions/Answers:

Solution 1:

Which version of bootstrap are you using? 3.1? Anyway, I need as well your css to help you to fix it, but generally:

@media (max-width: 1200px) {
    .navbar-header {
        float: none;
    }
    .navbar-left,.navbar-right {
        float: none !important;
    }
    .navbar-toggle {
        display: block;
    }
    .navbar-collapse {
        border-top: 1px solid transparent;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    }
    .navbar-fixed-top {
        top: 0;
        border-width: 0 0 1px;
    }
    .navbar-collapse.collapse {
        display: none!important;
    }
    .navbar-nav {
        float: none!important;
        margin-top: 7.5px;
    }
    .navbar-nav>li {
        float: none;
    }
    .navbar-nav>li>a {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .collapse.in{
        display:block !important;
    }
   .navbar-nav .open .dropdown-menu {
       position: static;
       float: none;
       width: auto;
       margin-top: 0;
       background-color: transparent;
       border: 0;
       -webkit-box-shadow: none;
       box-shadow: none;
    }
}

The max width is the breakpoint. Copied from Bootply (with demo included there).

Solution 2:

The following code will create a navbar breakpoint at 991 px. The .navbar-nav class is important if you have more than a few links in your navbar.

@media (max-width: 991px) {
  .navbar-header {
      float: none;
  }
  .navbar-left,.navbar-right {
      float: none !important;
  }
  .navbar-toggle {
      display: block;
  }
  .navbar-collapse {
      border-top: 1px solid transparent;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  }
  .navbar-fixed-top {
      top: 0;
      border-width: 0 0 1px;
  }
  .navbar-collapse.collapse {
      display: none!important;
  }
  .navbar-nav {
      float: none!important;
      margin-top: 7.5px;

      max-height: 300px;
      overflow-y: scroll!important;
  }
  .navbar-nav>li {
      float: none;
  }
  .navbar-nav>li>a {
      padding-top: 10px;
      padding-bottom: 10px;
  }
  .collapse.in{
      display:block !important;
  }

}

References

Related:  Bootstrap - Buttons inside List Group Item