Bootstrap Tutorial - Create full navbar with dropdown








The following code shows how to create full navbar with dropdown.

Example

<!--   w ww .  java2 s  .  com-->
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet"
  href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet"
  href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<script
  src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script
  src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

</head>
<body style='margin:30px'>
    <div class="container">
      <div class="navbar navbar-default">
          <div class="container-fluid">
              <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mynavbar-content">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">java2s.com</a>
        </div>
        
        <div class="collapse navbar-collapse" id="mynavbar-content">
            <ul class="nav navbar-nav">
              <li class="active"><a href="#">Home</a></li>
              <!-- Drop Down Code -->
              <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown">About <b class="caret"></b></a>
                  <ul class="dropdown-menu">
                      <li><a href="#">Board of Members</a></li>
                      <li><a href="#">Developers Team</a></li>
                      <li><a href="#">Designing Team</a></li>
                      <li class="divider"></li>
                      <li><a href="#">Investors</a></li>
                      <li><a href="#">Share holders</a></li>
                  </ul>
              </li>
              <li><a href="#">Pricing</a></li>
              <li><a href="#">Contact</a></li>
              <li><a href="#">Feedback</a></li>
            </ul>
        </div>
          </div>
      </div>
    </div>
</body>
</html>

Click to view the demo