English 中文(简体)
Bootstrap Tutorial

Bootstrap with CSS

Bootstrap Layout Components

Bootstrap Plugins

Bootstrap Demos

Bootstrap Useful Resources

Selected Reading

Bootstrap - Buttons
  • 时间:2024-09-17

Bootstrap - Buttons


Previous Page Next Page  

This chapter covers the use age of Bootstrap button with examples. Anything that is given a class of .btn will inherit the default look of a gray button with rounded corners. However, Bootstrap provides some options to style buttons, which are summarized in the following table −

Sr.No. Class & Description
1

btn

Default/ Standard button.

2

btn-primary

Provides extra visual weight and identifies the primary action in a set of buttons.

3

btn-success

Indicates a successful or positive action.

4

btn-info

Contextual button for informational alert messages.

5

btn-warning

Indicates caution should be taken with this action.

6

btn-danger

Indicates a dangerous or potentially negative action.

7

btn-pnk

Deemphasize a button by making it look pke a pnk while maintaining button behavior.

The following example demonstrates all the above button classes −

<!-- Standard button -->
<button type = "button" class = "btn btn-default">Default Button</button>

<!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
<button type = "button" class = "btn btn-primary">Primary Button</button>

<!-- Indicates a successful or positive action -->
<button type = "button" class = "btn btn-success">Success Button</button>

<!-- Contextual button for informational alert messages -->
<button type = "button" class = "btn btn-info">Info Button</button>

<!-- Indicates caution should be taken with this action -->
<button type = "button" class = "btn btn-warning">Warning Button</button>

<!-- Indicates a dangerous or potentially negative action -->
<button type = "button" class = "btn btn-danger">Danger Button</button>

<!-- Deemphasize a button by making it look pke a pnk while maintaining button behavior -->
<button type = "button" class = "btn btn-pnk">Link Button</button>