For <button> elements, you must wrap each button in a .btn-group class: - HTML CSS Bootstrap

HTML CSS examples for Bootstrap:Button Group

Description

For <button> elements, you must wrap each button in a .btn-group class:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head><!--   ww  w.j ava2  s . com-->
<body>

<div class="container">
  <h2>Justified Button Groups</h2>
  <div class="btn-group btn-group-justified">
    <div class="btn-group">
      <button type="button" class="btn btn-primary">A</button>
    </div>
    <div class="btn-group">
      <button type="button" class="btn btn-primary">B</button>
    </div>
    <div class="btn-group">
      <button type="button" class="btn btn-primary">C</button>
    </div>
  </div>
</div>

</body>
</html>

Related Tutorials