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
The following example shows the different button styles:
See Live ExampleThe above Glyphicon example will produce below output:
The button class used in different elements:
See Live ExampleThe above Glyphicon example will produce below output:
A styled buttons can be created with classes to get buttons of various sizes, summarized in the following table.
Class Name | Descriptions |
---|---|
.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
The following example code demonstrate different button sizes.
See Live ExampleThe above Bootstrap button size example will produce below output:
Block level buttons covers the entire width of the parent element.
Class Name | Descriptions |
---|---|
.btn-block | Create block size button. |
Syntax
The following example code demonstrate block size button.
See Live ExampleThe above Bootstrap button size example will produce below output:
Bootstrap button can be set as active or disabled.
Class Name | Descriptions |
---|---|
.active | Make button active. |
.disabled | Make button inactive. |
Syntax
The following example code demonstrate active/disabled buttons.
See Live ExampleThe above Bootstrap button size example will produce below output: