Bootstrap 4 Tutorial

BS4 Introduction

How to use Bootstrap

BS4 Layout

BS4 Grid System

BS4 Typography

BS4 Colors

BS4 Table

BS4 Images

BS4 Jumbotron

BS4 Alerts

BS4 Buttons

BS4 Button Group

BS4 Badges

BS4 Progress Bar

BS4 Pagination

BS4 Breadcrumb

BS4 Card

BS4 Collapse

BS4 Nav Tabs Pills

BS4 Navbar

BS4 Tooltip

BS4 Carousel

BS4 Scrollspy

BS4 Forms

BS4 Form Validation

BS4 Form Custom

Page Stats

Visitor: 500

Bootstrap 4 Badges

Badges are numerical indicator that represents, how many items are associated with a link. Badges can also be used to highlight new or unread items. To create badges use the ".badge" class within a <span> element.

<a href="#">HTML<span class="badge badge-secondary">15</span></a>
<a href="#">CSS<span class="badge badge-secondary">10</span></a>

Badges can also be used within a button element.

<button class="btn btn-success">HTML <span class="badge badge-light">15</span> </button>
<button class="btn btn-success">CSS <span class="badge badge-light">10</span> </button>

Bootstrap Labels

Labels are used to provide some additional information.

<h1>Example heading <span class="badge badge-secondary">New</span></h1>
<h3>Example heading <span class="badge badge-secondary">New</span></h3>

Example Paragaraph New

Example Paragaraph New


Contextual Badges

Add any of the below mentioned contextual classes to change the appearance of a badge.

Primary Secondary Success Danger Warning Info Light Dark
<span class="badge badge-primary">Primary</span>
<span class="badge badge-secondary">Secondary</span>
<span class="badge badge-success">Success</span>


Pill Badges

Use the .badge-pill class to make the badges more round:

Primary Secondary Success Danger Warning Info Light Dark
<span class="badge badge-pill badge-primary">Primary</span>
<span class="badge badge-pill badge-secondary">Secondary</span>
<span class="badge badge-pill badge-success">Success</span>
<span class="badge badge-pill badge-danger">Danger</span>
<span class="badge badge-pill badge-warning">Warning</span>
<span class="badge badge-pill badge-info">Info</span>
<span class="badge badge-pill badge-light">Light</span>
<span class="badge badge-pill badge-dark">Dark</span>