Bootstrap Buttons

Bootstrap provides built-in seven styles of button classes. A styled button can be created using any of the classes summarized in the following table. Remember, the button classes can be combined with <a>, <button>, or <link> element:

Syntax

Note: The * symbole in above syntax must be replaced with the name of the style e.g. btn-primary

Bootstrap Buttons Example

The following example shows the different button styles:

See Live Example

The above Glyphicon example will produce below output:

Bootstrap Buttons Example for Different Elements

The button class used in different elements:

See Live Example

The above Glyphicon example will produce below output:

Bootstrap Button Sizes

A styled buttons can be created with classes to get buttons of various sizes, summarized in the following table.

Class NameDescriptions
.btn-lg Create large size button.
.btn-md Create medium size button.
.btn-sm Create small size button.
.btn-xs Create extra small size button.

Syntax

Bootstrap Button Sizes Example

The following example code demonstrate different button sizes.

See Live Example

The above Bootstrap button size example will produce below output:

Bootstrap Block Level Buttons

Block level buttons covers the entire width of the parent element.

Class NameDescriptions
.btn-block Create block size button.

Syntax

Bootstrap Block Level Button Example

The following example code demonstrate block size button.

See Live Example

The above Bootstrap button size example will produce below output:

Bootstrap Active/Disabled Buttons

Bootstrap button can be set as active or disabled.

Class NameDescriptions
.active Make button active.
.disabled Make button inactive.

Syntax

Bootstrap Active/Disabled Buttons Example

The following example code demonstrate active/disabled buttons.

See Live Example

The above Bootstrap button size example will produce below output: