Bootstrap Tutorial

BS4 HomeBS4 Container

BS4 Borders

BS4 Border AdditiveBS4 Border SubtractiveBS4 Border ColorBS4 Border Radius

BS4 Float

BS4 floatBS4 clearfix

BS4 Close icon

BS4 Close Icon

BS4 Colors

BS4 ColorBS4 Background color

BS4 Display

BS4 Display NotationBS4 Display in Print

BS4 Embed

BS4 embed

BS4 Flex

BS4 FlexBS4 Flex DirectionBS4 justify-contentBS4 align-itemsBS4 align-selfBS4 align-contentBS4 Flex GrowBS4 Flex ShrinkBS4 Flex FillBS4 Flex WrapBS4 OrderBS4 Auto Margins

BS4 Sizing

BS4 WidthBS4 Height

BS4 Spacing

BS4 MarginBS4 PaddingBS4 Horizontal centering

BS4 Text

BS4 Text alignmentBS4 Text wrappingBS4 Text transformBS4 Font weight and italicsBS4 Text decorationBS4 Text resetBS4 Text monospace

BS4 Alignment

BS4 Vertical alignment

BS4 Visibility

BS4 Visibility

BS4 Overflow

BS4 Overflow

BS4 Link

BS4 Stretched Link

BS4 Shadow

BS4 Shadow

BS4 Position

BS4 Position

BS4 Typography

BS4 Typography HeadingsBS4 Typography Custom HeadingsBS4 Typography Display HeadingsBS4 Typography LeadBS4 Typography Inline textBS4 Typography AbbreviationsBS4 Typography BlockquotesBS4 Typography List UnstyledBS4 Typography List Inline

BS4 Code

BS4 Code InlineBS4 Code BlocksBS4 Code VariablesBS4 Sample OutputBS4 User input

BS4 Image

BS4 Image ResponsiveBS4 Image Thumbnails

BS4 Figures

BS4 Figure

BS4 Grid

BS4 Grid

BS4 Media Object

BS4 Media Object

BS4 Table

BS4 TableBS4 Table HeadBS4 Table CaptionsBS4 Table Responsive

BS4 Components

BS4 AlertBS4 BadgeBS4 BreadcrumbBS4 ButtonBS4 Button GroupBS4 CardBS4 CarouselBS4 CollapseBS4 DropdownBS4 FormBS4 Input GroupBS4 JumbotronBS4 List GroupBS4 ModalBS4 NavsBS4 NavbarBS4 PaginationBS4 PopoversBS4 ProgressBS4 SpinnersBS4 TooltipsBS4 ToastsBS4 Scrollspy

Bootstrap4 Button

Last Updated:

Basic Button

Use .btn class to create a button and .btn-{color} to add specific color to a button.

Example

Button Tags

The .btn classes are designed to be used with the <button> element. However, you can also use these classes on <a> or <input> elements.

Example

Link

Button Outline

Use .btn-outline-{color} to outline the button with color of your choice.

Example

Button Sizing

Use .btn-{sm|lg} to set the size of the button.

Example

Button State

Use disabled or active attributes to set the state of the button.

Example

Button Toggle

Add data-toggle="button" to toggle a button.

Example

Button Radio

Use .btn-group and .btn-group-toggle to create a toggle radio button.

Example

Classes

The following table provides a list of all classes to create button.

Class Explanation
.btn Creates a basic button (gray background and rounded corners).
.btn-primary Button with css background-color '#0069d9'.
.btn-secondary Button with css background-color '#6c757d'.
.btn-success Button with css background-color '#28a745'.
.btn-danger Button with css background-color '#dc3545'.
.btn-warning Button with css background-color '#ffc107'.
.btn-info Button with css background-color '#17a2b8'.
.btn-light Button with css background-color '#f8f9fa'.
.btn-dark Button with css background-color '#343a40'.
.btn-link Button with css text-decoration 'none'.
.btn-outline-primary Button with css border-color '#007bff'.
.btn-outline-secondary Button with css border-color '#6c757d'.
.btn-outline-success Button with css border-color '#28a745'.
.btn-outline-danger Button with css border-color '#dc3545'.
.btn-outline-warning Button with css border-color '#ffc107'.
.btn-outline-info Button with css border-color '#17a2b8'.
.btn-outline-light Button with css border-color '#f8f9fa'.
.btn-outline-dark Button with css border-color '#343a40'.
.btn-sm Small button.
.btn-lg Large button.
.btn-block Display button as block Element.

Share this Page

Meet the Author