CodesJava

Easy learning with example program codes

Bootstrap 4 List Group Contextual Classes

Bootstrap provides .list-group-item-success, list-group-item-secondary, list-group-item-info, list-group-item-warning, .list-group-item-danger, list-group-item-dark and list-group-item-light classes to color list items.

Bootstrap 4 Group Contextual Classes Example:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap 4 Contextual Classes Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</head>
<body>
 
<div class="container">
  <h2>List Group With Contextual Classes</h2>
  <ul class="list-group">
    <li class="list-group-item list-group-item-success">Success item</li>
    <li class="list-group-item list-group-item-secondary">Secondary item</li>
    <li class="list-group-item list-group-item-info">Info item</li>
    <li class="list-group-item list-group-item-warning">Warning item</li>
    <li class="list-group-item list-group-item-danger">Danger item</li>
    <li class="list-group-item list-group-item-primary">Primary item</li>
    <li class="list-group-item list-group-item-dark">Dark item</li>
    <li class="list-group-item list-group-item-light">Light item</li>
  </ul>
 
<h2>Linked Items With Contextual Classes</h2>
  <div class="list-group">
    <a href="#" class="list-group-item list-group-item-action">Action item</a>
    <a href="#" class="list-group-item list-group-item-success">Success item</a>
    <a href="#" class="list-group-item list-group-item-secondary">Secondary item</a>
    <a href="#" class="list-group-item list-group-item-info">Info item</a>
    <a href="#" class="list-group-item list-group-item-warning">Warning item</a>
    <a href="#" class="list-group-item list-group-item-danger">Danger item</a>
    <a href="#" class="list-group-item list-group-item-primary">Primary item</a>
    <a href="#" class="list-group-item list-group-item-dark">Dark item</a>
    <a href="#" class="list-group-item list-group-item-light">Light item</a>
  </div>
</div>
 
</body>
</html>

Try it:

Bootstrap 4 Contextual Classes Example on jsbin.com

Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status