Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap Badges inside Nav</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script> </head> <body> <div class="m-4"> <nav class="nav nav-pills"> <a href="#" class="nav-link">Home</a> <a href="#" class="nav-link">Profile</a> <a href="#" class="nav-link active">Messages <span class="badge bg-light text-primary">24</span></a> <a href="#" class="nav-link">Notification <span class="badge bg-primary">5</span></a> </nav> </div> </body> </html>