WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Bootstrap Buttons


In this chapter we discuss bootstrap button

Button Styles

Bootstrap supports seven styles of buttons:

Bootstrap button support following class:

  • .btn-default
  • .btn-primary
  • .btn-success
  • .btn-info
  • .btn-warning
  • .btn-danger
  • .btn-link

the below example will help to create different button styles:

Example

<button type="button" class="btn btn-default">Default</button>
<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-warning">Warning</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-link">Link</button>
Try it Yourself »

The button classes can be used on an <a>, <button>, or <input> element:

Example

<a href="#" class="btn btn-info" role="button">Link Button</a>
<button type="button" class="btn btn-info">Button</button>
<input type="button" class="btn btn-info" value="Input Button">
<input type="submit" class="btn btn-info" value="Submit Button">
Try it Yourself »

Button Sizes

Bootstrap support four button sizes:

The Bootstrap support class are following :

  • .btn-lg
  • .btn-md
  • .btn-sm
  • .btn-xs

The below example will help to create different button sizes:

Example

<button type="button" class="btn btn-primary btn-lg">Large</button>
<button type="button" class="btn btn-primary btn-sm">Small</button>
<button type="button" class="btn btn-primary btn-md">Medium</button>
<button type="button" class="btn btn-primary btn-xs">XSmall</button>
Try it Yourself »

Block Level Buttons

A block level button spans the entire width of the parent element.

You can add class .btn-block to create a block level button:

Example

<button type="button" class="btn btn-primary btn-block">Button 1</button>
<button type="button" class="btn btn-primary btn-block">Button 2</button>
Try it Yourself »

Active/Disabled Buttons

You can set button to active or disabled

In this class .active makes a button appear pressed and the class .disabled makes a button unclickable:

Example

<button type="button" class="btn btn-primary active">Active Primary</button>
<button type="button" class="btn btn-primary disabled">Disabled Primary</button>
Try it Yourself »