2 Example(s) of Bootstrap Listgroups


Description :

.list-group class is used to make a group of listings.


Bootstrap Listgroups Example - 1
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Bootstrap Listgroups 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>Contextual listgroup</h2>
        <ul class="list-group">
            <li class="list-group-item list-group-item-success">listing 1</li>
            <li class="list-group-item list-group-item-info">listing 2</li>
            <li class="list-group-item list-group-item-warning">listing 3</li>
            <li class="list-group-item list-group-item-danger">listing 4</li>
        </ul>
    </div>
</body>
</html>

Output

Description :

.list-group class is used to make a group of listing and badges are also inserted into listitems.


Bootstrap Listgroups Example - 2
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Bootstrap Listgroups 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>List Group With Badges</h2>
        <ul class="list-group">
            <li class="list-group-item active"><span class="badge">12</span>listing 1</li>
            <li class="list-group-item"><span class="badge">5</span>listing 2</li>
            <li class="list-group-item disabled"><span class="badge">3</span>listing 3</li>
        </ul>
    </div>
</body>
</html>

Output