Bootstrap Tutorial - Create Button based dropdown menu








The following code shows how to create Button based dropdown menu.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
<style type='text/css'>
.dropdown-menu {<!--   www  .ja  v a  2 s. c om-->
  min-width: 0px;
}
</style>
</head>
<body style='margin:30px'>
  <div class="row">
    <div>
      <div class="dropdown">
        <button type="button" class="btn btn-danger dropdown-toggle"
          data-toggle="dropdown">Button</button>
        <ul class="dropdown-menu" role="menu">
          <li><a href="#">Action</a></li>
          <li><a href="#">Actiossssn</a></li>
          <li><a href="#">Action</a></li>
        </ul>
      </div>
    </div>
</body>
</html>

Click to view the demo