loading

BS Button Groups

Button Groups

In Bootstrap, you may group a sequence of buttons together (on a single line) in a button group.

------Button mukava -----

To build a button group, use a <div> element with the class .btn-group.

Example

				
					<div class="btn-group">
  <button type="button" class="btn btn-primary">Apple</button>
  <button type="button" class="btn btn-primary">Samsung</button>
  <button type="button" class="btn btn-primary">Sony</button>
</div>
				
			

Tip: Rather than applying button sizes to all buttons in a group, use class. To size all buttons in the group, use .btn-group-lg|sm|xs.

Example

				
					<div class="btn-group btn-group-lg">
  <button type="button" class="btn btn-primary">Apple</button>
  <button type="button" class="btn btn-primary">Samsung</button>
  <button type="button" class="btn btn-primary">Sony</button>
</div>
				
			

Vertical Button Groups

Bootstrap supports four button sizes:

----- Button mukava ------

Bootstrap also allows vertical button groups:

------ button mukva -----

To build a vertical button group, use the class .btn-group-vertical.

Example

				
					<div class="btn-group-vertical">
  <button type="button" class="btn btn-primary">Apple</button>
  <button type="button" class="btn btn-primary">Samsung</button>
  <button type="button" class="btn btn-primary">Sony</button>
</div>
				
			

Justified Button Groups

To cover the entire width of the screen, use the .btn-group-justified class.

----- Button mukava ------

Example with <a> elements:

Example

				
					<div class="btn-group btn-group-justified">
  <a href="#" class="btn btn-primary">Apple</a>
  <a href="#" class="btn btn-primary">Samsung</a>
  <a href="#" class="btn btn-primary">Sony</a>
</div>
				
			

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

Example

				
					<div class="btn-group btn-group-justified">
  <div class="btn-group">
    <button type="button" class="btn btn-primary">Apple</button>
  </div>
  <div class="btn-group">
    <button type="button" class="btn btn-primary">Samsung</button>
  </div>
  <div class="btn-group">
    <button type="button" class="btn btn-primary">Sony</button>
  </div>
</div>
				
			

Nesting Button Groups & Dropdown Menus

----- Button mukava ------

Use button groups to construct dropdown menus:

Example

				
					<div class="btn-group">
  <button type="button" class="btn btn-primary">Apple</button>
  <button type="button" class="btn btn-primary">Samsung</button>
  <div class="btn-group">
    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
    Sony <span class="caret"></span></button>
    <ul class="dropdown-menu" role="menu">
      <li><a href="#">Tablet</a></li>
      <li><a href="#">Smartphone</a></li>
    </ul>
  </div>
</div>
				
			

Split Button Dropdowns

----- Button mukava ------

Example

				
					<div class="btn-group">
  <button type="button" class="btn btn-primary">Sony</button>
  <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
    <span class="caret"></span>
  </button>
  <ul class="dropdown-menu" role="menu">
    <li><a href="#">Tablet</a></li>
    <li><a href="#">Smartphone</a></li>
  </ul>
</div>
				
			
Share this Doc

BS Button Groups

Or copy link

Explore Topic