12 Program to demonstrate List Group and Badges in Bootstrap

Program:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
        integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
    <!-- CSS only -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
        integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">

    <!-- JS, Popper.js, and jQuery -->
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
        integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous">
    </script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
        integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous">
    </script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"
        integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous">
    </script>
    <title>Listgroups & Badges in Bootstrap4</title>
</head>

<body>

    <nav class="navbar navbar-expand-sm navbar-dark bg-success">
        <a class="navbar-brand" href="#">Listgroups & Badges in Bootstrap4</a>
        <button class="navbar-toggler" data-toggle="collapse" data-target="#navbarNav">
            <span class="navbar-toggler-icon"></span>
        </button>
    </nav>

    <div class="container mt-5">
        <!--########################START HERE#########################-->

        <!-- LIST GROUP -->
        <ul clas="list-group">
            <li class="list-group-item">My List Item One</li>
            <li class="list-group-item">My List Item Two</li>
            <li class="list-group-item">My List Item Three</li>
            <li class="list-group-item">My List Item Four</li>
            <li class="list-group-item">My List Item Five</li>
        </ul>

        <br><br>

        <!-- CONTEXTUAL CLASSES -->
        <ul class="list-group">
            <li class="list-group-item list-group-item-primary">My List Item One</li>
            <li class="list-group-item list-group-item-secondary">My List Item Two</li>
            <li class="list-group-item list-group-item-success">My List Item Three</li>
            <li class="list-group-item list-group-item-danger">My List Item Four</li>
            <li class="list-group-item list-group-item-warning">My List Item Five</li>
        </ul>

        <br><br>

        <!-- LIST GROUP WITH BADGES -->
        <ul class="list-group">
            <li class="list-group-item">My List Item One</li>
            <li class="list-group-item d-flex justify-content-between align-items-center">My List Item Two <span
                    class="badge badge-primary badge-pill">23</span></li>
            <li class="list-group-item">My List Item Three <span class="badge badge-primary badge-pill">43</span></li>
            <li class="list-group-item">My List Item Four</li>
            <li class="list-group-item">My List Item Five</li>
        </ul>

        <br><br>

        <!-- CUSTOM CONTENT -->
        <div class="list-group">
            <a href="#" class="list-group-item  list-group-item-action flex-column align-items-start active">
                <div class="d-flex w-100 justify-content-between">
                    <h5>My Post One</h5>
                    <small>3 days ago</small>
                </div>
                <p>Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
                <small>By Atharva Agrawal</small>
            </a>
            <a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
                <div class="d-flex w-75 justify-content-between">
                    <h5>My Post Two</h5>
                    <small>3 days ago</small>
                </div>
                <p>Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
                <small>By Atharva Agrawal</small>
            </a>
            <a href="#" class="list-group-item list-group-item-action flex-column align-items-end">
                <div class="d-flex w-50 justify-content-end">
                    <h5>My Post Three</h5>
                    <small>3 days ago</small>
                </div>
                <p>Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
                <small>By Atharva Agrawal</small>
            </a>
        </div>

        <br><br>

        <!-- BREADCRUMB -->
        <ol class="breadcrumb">
            <li class="breadcrumb-item active" aria-current="page">Home</li>
        </ol>

        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="#">Home</a></li>
            <li class="breadcrumb-item active" aria-current="page">Users</li>
        </ol>

        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="#">Home</a></li>
            <li class="breadcrumb-item"><a href="#">Users</a></li>
            <li class="breadcrumb-item active" aria-current="page">Atharva</li>
        </ol>

    </div><!-- ./container -->
    <div style="margin-top:500px;"></div>

    <!-- BODY ENDS -->
</body>

</html>


Output:

List Group and Badges in Bootstrap

Previous
Next Post »