Bootstrap Tutorial - Create segmented dropdown groups








The following code shows how to create segmented dropdown groups.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-git2.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://getbootstrap.com/assets/css/docs.css">
<link rel="stylesheet" type="text/css"
  href="http://getbootstrap.com/dist/css/bootstrap.css">
<script type='text/javascript'
  src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
</head><!--from  w ww  . j  a  v a2s  .  c  o  m-->
<body style='margin:30px'>
  <div class="input-group">
    <input type="text" class="form-control " placeholder="username">
    <div class="input-group-btn">
      <!--simple button-->
      <button type="button" class="btn btn-default">Simple</button>
      <!--dropdown button-->
      <button type="button" class="btn btn-default dropdown-toggle"
        data-toggle="dropdown">
        <span class="caret"></span>
      </button>
      <ul class="dropdown-menu">
        <li><a href="#">Dropdown link</a></li>
        <li><a href="#">Dropdown link</a></li>
      </ul>
    </div>
  </div>
</body>
</html>

Click to view the demo