ShapeYourPath
(current)
Run Code
Live Code Editor- Bootstrap 5 Badge Contextual Classes
Source Code
<!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <!-- Bootstrap CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet"> <title>Bootstrap 5 Contextual Badge</title> </head> <body> <h1 class="mt-2 text-success text-center">Bootstrap Contextual Badge</h1> <p> In this example, you will learn how to create Bootstrap 5 colored badges through contextual (badge-*) classes. Here* denotes primary, success, danger, info, etc. </p> <div class="container mt-5"> <span class="badge bg-primary">Primary</span> <span class="badge bg-secondary">Secondary</span> <span class="badge bg-success">Success</span> <span class="badge bg-danger">Danger</span> <span class="badge bg-warning">Warning</span> <span class="badge bg-info">Info</span> <span class="badge bg-light">Light</span> <span class="badge bg-dark">Dark</span> </div> <!--/container--> <!-- Option 1: Bootstrap Bundle with Popper --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"></script> </body> </html>
Output :
Running