Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Bs5 Badges in Bootstrap

Bs5 Badges in Bootstrap

In Bootstrap 5 (BS5), badges are small count and labeling components used to add extra information or highlight items like notifications, statuses, or tags.


?? Basic Badge

<span class="badge bg-primary">Primary</span>

? Contextual Color Classes

You can use different bg-* classes for various contexts:

ClassDescription
bg-primaryPrimary badge
bg-secondarySecondary badge
bg-successSuccess message
bg-dangerDanger alert
bg-warningWarning message
bg-infoInformational message
bg-lightLight themed badge
bg-darkDark themed badge

? Badge Inside Headings

<h1>Notifications <span class="badge bg-danger">New</span></h1>

? Badge in Buttons

<button type="button" class="btn btn-primary">  Messages <span class="badge bg-light text-dark">4</span></button>

? Pill Badges

Rounded-pill badges use the .rounded-pill class:

<span class="badge bg-success rounded-pill">Success</span>

? Badge with Links

Badges can be used as links by applying them to <a> elements:

<a href="#" class="badge bg-info text-decoration-none">Click Me</a>

?? Deprecated Classes in BS5

  • Bootstrap 5 removed the .badge-* color classes (used in BS4).

  • Use .bg-* for background color and text-* for text color.


Would you like to see examples with icons, dropdowns, or notification indicators next?

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql