Create a Bootstrap List Group with Badges
📖 Scenario: You are building a simple webpage to show a list of tasks with the number of pending items next to each task. You want to use Bootstrap's list group component with badges to display this clearly.
🎯 Goal: Build a Bootstrap list group with three items: Inbox, Sent, and Drafts. Each item should have a badge showing the number of messages: 5 for Inbox, 2 for Sent, and 1 for Drafts.
📋 What You'll Learn
Use a
<ul> element with the class list-group to create the list.Add three
<li> elements with the class list-group-item for the items.Add a Bootstrap badge with the class
badge bg-primary rounded-pill inside each list item to show the numbers 5, 2, and 1 respectively.Include the Bootstrap CSS link in the
<head> section.Use semantic HTML and ensure the page is responsive.
💡 Why This Matters
🌍 Real World
List groups with badges are common in email apps, notification centers, and dashboards to show counts clearly next to items.
💼 Career
Knowing how to use Bootstrap components helps you quickly build clean, responsive user interfaces that are accessible and visually consistent.
Progress0 / 4 steps