YouTip LogoYouTip

Bootstrap Buttons

This chapter will explain how to use Bootstrap buttons through examples. Any element with the class **.btn** will inherit the default appearance of a rounded gray button. However, Bootstrap provides several options to define button styles, as shown in the following table: The following styles can be used on , [Try it Β»](#) The result is as follows: ![Image 1: Button Options](#) The following table lists the classes for getting buttons of various sizes: | Class | Description | | --- | --- | | .btn-lg | This makes the button look larger. | | .btn-sm | This makes the button look smaller. | | .btn-xs | This makes the button look extra small. | | .btn-block | This creates a block-level button, spanning the full width of the parent element. | The following example demonstrates all the button classes above: ## Example

[Try it Β»](#) The result is as follows: ![Image 2: Button Sizes](#) Bootstrap provides classes for button states like active and disabled, which will be explained in detail below. ### Active State Buttons appear pressed (with a darker background, darker border, and inset shadow) when active. The following table lists the classes for making button elements and anchor elements appear active: | Element | Class | | --- | --- | | Button Element | Add the **.active** class to show it is active. | | Anchor Element | Add the **.active** class to the
button to show it is active. | The following example demonstrates this: ## Example

[Try it Β»](#) The result is as follows: ![Image 3: Button Active State](#) ### Disabled State When you disable a button, its color fades by 50% and loses the gradient. The following table lists the classes for making button elements and anchor elements appear disabled: | Element | Class | | --- | --- | | Button Element | Add the **disabled** _attribute_ to the

LinkDisabled Link

Original LinkDisabled Original Link

[Try it Β»](#) The result is as follows: ![Image 4: Button Disabled State](#) You can use button classes on , [Try it Β»](#) The result is as follows: ![Image 5: Button Tags](#) * * * ## Button Groups You can create button groups directly in a div using .btn-group: ## Example
[Try it Β»](#) Use .btn-group-lg|sm|xs to control the size of the button group: ## Example
[Try it Β»](#) To set a vertical button group, you can use the .btn-group-vertical class: ## Example
[Try it Β»](#) * * * ## Justified Button Groups You can create justified button groups using the .btn-group-justified class. The following example uses tags: ## Example [Try it Β»](#) **Note:** If using `
[Try it Β»](#) * * * ## Button Groups with Dropdown Menus Buttons within a button group can have dropdown menus, as shown in the following example: ## Example
[Try it Β»](#) ### Split Button ## Example [Try it Β»](#)
← Bootstrap ImagesBootstrap Forms β†’