Book Image

Bootstrap for Rails

By : Syed F Rahman
Book Image

Bootstrap for Rails

By: Syed F Rahman

Overview of this book

Table of Contents (18 chapters)
Bootstrap for Rails
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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.

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: This is for a red color

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...