rodrigobertin
7/27/2016 - 12:44 PM

Navbar responsive Bootstrap justified

Navbar responsive Bootstrap justified

/* CSS used here will be applied after bootstrap.css */
.navbar .navbar-nav-justified {
  padding-left: 0;
  padding-right: 0;
}

.navbar .navbar-collapse > .nav-justified.nav-pills > li > a {
  padding-top: 15px;
  padding-bottom: 15px;
  margin-bottom: 0;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
}

.navbar .navbar-collapse > .nav-justified.nav-pills > li + li {
  margin-left: 0;
  border-top: solid 1px #e7e7e7;
}

.navbar-toggle-center {
  width: 100%;
  float: none;
  margin: 0 auto;
  border-width: 0;
  border-radius: 0;
  padding: 14px 15px;
  font-size: 16px;
}

@media (min-width: 768px) {
  .navbar .navbar-collapse > .nav-justified.nav-pills > li:first-child > a {
    -webkit-border-radius: 4px 0 0 4px;
    -moz-border-radius: 4px 0 0 4px;
    border-radius: 4px 0 0 4px;
  }

  .navbar .navbar-collapse > .nav-justified.nav-pills > li:last-child > a {
    -webkit-border-radius: 0 4px 4px 0;
    -moz-border-radius: 0 4px 4px 0;
    border-radius: 0 4px 4px 0;
  }

  .navbar .navbar-collapse > .nav-justified.nav-pills > li + li {
    margin-left: 0;
    border-left: solid 1px #e7e7e7;
    border-top: 0;
  }
}
<nav class="navbar navbar-default">
    <div>
      <div class="navbar-header" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <button type="button" class="navbar-toggle collapsed navbar-toggle-center" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
          <span class="sr-only">Toggle navigation</span>
          <span class="glyphicon glyphicon-menu-hamburger"></span>
          <span class="navmenu">MENU</span>
        </button>
      </div>
      <div class="collapse navbar-collapse navbar-nav-justified" id="bs-example-navbar-collapse-1">
        <ul class="nav nav-pills nav-justified">
          <li class="active"><a href="#">Home</a></li>
          <li><a href="#">Projects</a></li>
          <li><a href="#">Services</a></li>
          <li><a href="#">Downloads</a></li>
          <li><a href="#">About</a></li>
          <li><a href="#">Contact</a></li>
        </ul>
      </div>
    </div>
  </nav>