Bootstrap Tutorial - Bootstrap Navigation Pill








<!DOCTYPE HTML>
<html>
<head>
<link href="http://java2s.com/style/bootstrap.min.css" rel="stylesheet">
<script src="http://java2s.com/style/jquery-1.8.0.min.js"></script>
<script src="http://java2s.com/style/bootstrap.min.js"></script>
<!--from  w  w  w .ja va  2 s. co  m-->
</head>
<body style='margin: 20px;'>

  <ul class="nav nav-pills">
    <li class="active"><a href="#">Regular link</a></li>
    <li class="dropdown"><a id="drop4" role="button"
      data-toggle="dropdown" href="#">Dropdown <b class="caret"></b></a>
      <ul id="menu1" class="dropdown-menu" role="menu"
        aria-labelledby="drop4">
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Action</a></li>
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Another action</a></li>
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Something else here</a></li>
        <li role="presentation" class="divider"></li>
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Separated link</a></li>
      </ul></li>
    <li class="dropdown"><a id="drop5" role="button"
      data-toggle="dropdown" href="#">Dropdown 2 <b class="caret"></b></a>
      <ul id="menu2" class="dropdown-menu" role="menu"
        aria-labelledby="drop5">
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Action</a></li>
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Another action</a></li>
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Something else here</a></li>
        <li role="presentation" class="divider"></li>
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Separated link</a></li>
      </ul></li>
    <li class="dropdown"><a id="drop6" role="button"
      data-toggle="dropdown" href="#">Dropdown 3 <b class="caret"></b></a>
      <ul id="menu3" class="dropdown-menu" role="menu"
        aria-labelledby="drop6">
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Action</a></li>
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Another action</a></li>
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Something else here</a></li>
        <li role="presentation" class="divider"></li>
        <li role="presentation"><a role="menuitem" tabindex="-1"
          href="">Separated link</a></li>
      </ul></li>
  </ul>

</body>
</html>

Click to view the demo