Bootstrap Labels
This chapter explains Bootstrap labels. Labels can be used for counting, notifications, or other marking displays on a page. Use the class .label to display a label, as shown in the example below:
Example
<
h1
Example Heading
<span class=">label label-default
"
Label
span
h1
<
h2
Example Heading
<span class=">label label-default
"
Label
span
h2
<
h3
Example Heading
<span class=">label label-default
"
Label
span
h3
<
h4
Example Heading
<span class=">label label-default
"
Label
span
h4
Try it »
The result is as follows:
You can use modifier classes label-default、label-primary、label-success、label-info、label-warning、label-danger to change the appearance of a label, as shown in the example below:
Example
<span class=">label label-default
"
Default Label
span
<span class=">label label-primary
"
Primary Label
span
<span class=">label label-success
"
Success Label
span
<span class=">label label-info
"
Info Label
span
<span class=">label label-warning
"
Warning Label
span
<span class=">label label-danger
"
Danger Label
span
Try it »
The result is as follows:
More Label Examples
| class | Description | Example |
|---|---|---|
| .label label-default | Default gray label | Try it |
| .label label-primary | Blue label of type "primary" | Try it |
| .label label-success | Green label of type "success" | Try it |
| .label label-info | Light blue label of type "info" | Try it |
| .label label-warning | Yellow label of type "warning" | Try it |
| .label label-danger | Red label of type "danger" | Try it |