Bootstrap Tutorial - Create list inline dropdown menu








The following code shows how to create list inline dropdown menu.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css">
</head><!--   ww  w  . j  a  va2 s. c om-->
<body style='margin:30px'>
  <nav class="navbar navbar-default navbar-static-top" role="navigation">
    <ul class="nav navbar-nav">
      <li class="dropdown"><a href="#" class="dropdown-toggle"
        data-toggle="dropdown">List Item</a>
        <ul class="dropdown-menu">
          <ul class='list-inline'>
            <li><a href="#" id="">1</a></li>
            <li><a href="#" id="">2</a></li>
            <li><a href="#" id="">3</a></li>
            <li><a href="#" id="">4</a></li>
            <li><a href="#" id="">5</a></li>
          </ul>
        </ul></li>
    </ul>
  </nav>
</body>
</html>

Click to view the demo