Lesson 12: Badges in Bootstrap 5

Badges in Bootstrap are essential when developing web and application applications. In this article, lets explore how to use badges in Bootstrap with TipsMake.com!

Badges in Bootstrap are essential when developing web and application applications. In this article, let's explore how to use badges in Bootstrap with TipsMake.com !

 

If you frequently browse the web or use apps, you'll often see badges or emblems. These can be notification icons, navigation buttons, or markers for special content.

Badges in Bootstrap 5 are similar. They are small labels that display brief information. They are used to add supplementary information to other elements on a webpage.

Using badges in Bootstrap 5 is very easy. Basically, you just need to use the CSS classes ` .badge` and `badge-*` within your `span` or `div` tag. For example, if you want to create a green badge, you can use the following HTML code:

Thông tin quan trọng

CSS classes like `.badge-pill` and `.badge-lg` help you create circular or larger badges. Here's an example of sample code to create a large red circular badge:

Thông báo

Additionally, you can use the `.badge-primary`, `.badge-secondary`, `.badge-success`, `.badge-info`, `.badge-warning`, `.badge-danger`, `.badge-light`, and `.badge-dark` classes to design badges in Bootstrap 5. Here are the detailed instructions:

Badges are often used to display additional information, marking items as new or unread. To create a badge, simply add it to links, navigation, etc.

When the additional information section is blank, the Badge will be collapsed via the selector.:empty

 

Badges are commonly used in several situations, as shown in the image below:

Contextual Badges

Use the class .badgealong with the context class (like ` .bg-secondary`) in the elements to create rectangular badges with corresponding colors. See the following example for a better understanding:

 Ví dụ về Bootstrap - TipsMake.com 

Examples of Badges

New Example Heading

Unread articles 5

You have new messages 20+

Some other HOT examples

The result will be as follows:

Pill badge

Besides rectangular badges with rounded corners, you can create softer-looking badges by using additional classes .rounded-pillaccordingly :

 

 Ví dụ về Bootstrap - TipsMake.com 

Examples of Badges

New Example Heading

Unread articles 5

You have new messages 20+

Some other HOT examples

With the HTML file above, you will get the following badges:

A badge is placed inside an object.

You can place the active badge inside your website's navigation or any button. Simply place it next to the link or button, as in the following example:

 Ví dụ về Bootstrap - TipsMake.com 

Badge inside the Button

   

The result will have the following interface:

At the end of this lesson, we've learned how to use Badges in some basic situations. Continue with the next lessons to better understand how to use Badges more effectively.

Related posts
Other Program articles
  • Lesson 11: Button Groups in Bootstrap 5

    btn-group bootstrap 5 là gì? cách tạo hay dùng button trong bootstrap 5 như thế nào? hãy cùng tipsmake.com.com tìm hiểu nhé!
  • Lesson 10: Buttons in Bootstrap 5 - How to create different types of buttons in Bootstrap

    btn php hay button bootstrap 5 là gì? bài viết sẽ tổng hợp cho bạn các loại button và cách tạo chúng trong bootstrap như thế nào nhé!
  • Lesson 9: Alerts in Bootstrap 5

    alert bootstrap 5 là gì? bootstrap 5 alert là một thành phần quan trọng trong phát triển web, ứng dụng. dưới đây là mọi điều bạn cần biết về alert trong bootstrap 5.
  • Lesson 8: Jumbotron in Bootstrap 5

    trong bootstrap, jumbotron là một box màu xám chứa văn bản, với mục đích là tăng thêm sự chú ý cho văn bản trong đó. khi cảm thấy văn bản/thông tin nào thật quan trọng, cần phải làm cho nó xuất hiện thật lớn, thật gây chú ý, bạn chỉ cần viết nó trong jumbotron.
  • Lesson 6: Tables in Bootstrap 5

    table trong bootstrap là gì? cách tạo table trong bootstrap như thế nào? hãy cùng tipsmake.com.com tìm hiểu nhé!
  • Lesson 5: Colors in Bootstrap 5

    màu trong bootstrap được sử dụng như thế nào? Ở bài viết này, hãy cùng nhau tìm hiểu mọi điều về màu bootstrap nhé!
Category

System

Windows XP

Windows Server 2012

Windows 8

Windows 7

Windows 10

Wifi tips

Virus Removal - Spyware

Speed ​​up the computer

Server

Security solution

Mail Server

LAN - WAN

Ghost - Install Win

Fix computer error

Configure Router Switch

Computer wallpaper

Computer security

Mac OS X

Mac OS System software

Mac OS Security

Mac OS Office application

Mac OS Email Management

Mac OS Data - File

Mac hardware

Hardware

USB - Flash Drive

Speaker headset

Printer

PC hardware

Network equipment

Laptop hardware

Computer components

Advice Computer

Game

PC game

Online game

Mobile Game

Pokemon GO

information

Technology story

Technology comments

Quiz technology

New technology

British talent technology

Attack the network

Artificial intelligence

Technology

Smart watches

Raspberry Pi

Linux

Camera

Basic knowledge

Banking services

SEO tips

Science

Strange story

Space Science

Scientific invention

Science Story

Science photo

Science and technology

Medicine

Health Care

Fun science

Environment

Discover science

Discover nature

Archeology

Life

Travel Experience

Tips

Raise up child

Make up

Life skills

Home Care

Entertainment

DIY Handmade

Cuisine

Christmas

Application

Web Email

Website - Blog

Web browser

Support Download - Upload

Software conversion

Social Network

Simulator software

Online payment

Office information

Music Software

Map and Positioning

Installation - Uninstall

Graphic design

Free - Discount

Email reader

Edit video

Edit photo

Compress and Decompress

Chat, Text, Call

Archive - Share

Electric

Water heater

Washing machine

Television

Machine tool

Fridge

Fans

Air conditioning

Program

Unix and Linux

SQL Server

SQL

Python

Programming C

PHP

NodeJS

MongoDB

jQuery

JavaScript

HTTP

HTML

Git

Database

Data structure and algorithm

CSS and CSS3

C ++

C #

AngularJS

Mobile

Wallpapers and Ringtones

Tricks application

Take and process photos

Storage - Sync

Security and Virus Removal

Personalized

Online Social Network

Map

Manage and edit Video

Data

Chat - Call - Text

Browser and Add-on

Basic setup