Labels and badges are very basic components in Bootstrap. You can use them with any text-like components to display a highlighted text. Here's an example of labels and badges:
<h3>Packt Publishing <span class="label label-default">New Books!</span></h3>
Labels are created using inline elements such as <span>
, it has got a class .label
and many color classes such as .label-default
for a dark gray color.
Different colors available for labels are:
Badges, on the other hand, are labels with a self collapsing nature. This means that when there's no content inside a badge, it will not appear in the HTML page. This gives you an option to create a notification icon using badges. They are mostly used for displaying numbers. Badges also...