1 Example(s) of Bootstrap Badges


Description :

Badges are used to represent how many items are associated to that link.Here .badge class is used to add Badges in button and anchor tag.


Bootstrap Badges Example - 1
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Bootstrap Badges Example</title>
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
    <div class="container">
        <h2>Badges</h2>
        <a href="#">News <span class="badge">5</span></a><br>  <!--Badges in anchor tag.--></br>
        <button type="button" class="btn btn-primary">Primary <span class="badge">7</span></button> <!--Badges in button.-->
    </div>
</body>
</html>

Output