O'Reilly logo

Bootstrap for Rails by Syed Fazle Rahman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Bootstrap labels and badges

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.

Bootstrap labels and badges

Different colors available for labels are:

  • .label-primary: This is for a dark blue color
  • .label-info: This is for a light blue color
  • .label-success: This is for a green color
  • .label-warning: This is for a yellow color
  • .label-danger ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required