Bootstrap 3 Tutorial
The simplest list group is an unordered list with list items:
To make a basic list group, use a <ul> element with class .list-group and <li> elements with class .list-group-item.
- First item
- Second item
- Third item
You can also include badges in a list group. The badges will automatically be positioned to the right.
To make a badge, insert a <span> element with class .badge within the list item:
- New 12
- Deleted 5
- Warnings 3
The items in a list group may also be hyperlinks. This will add a grey background color on hover.
To build a linked list group, use <div> instead of <ul> and <a> instead of <li>.
Use the .active class to highlight the current item:
The following list group contains a disabled item:
To disable an object, use the .disabled class:
Contextual classes can be used to color list items.
The classes for coloring list items are: .list-group-item-success, list-group-item-info, and list-group-item-warning, .list-group-item-danger:
- First item
- Second item
- Third item
- Fourth item
You can include almost any HTML within a list group item.
Bootstrap includes the classes .list-group-item-heading and .list-group-item-text, which can be used as follows:
CodingAsk.com is designed for learning and practice. Examples may be made simpler to aid understanding. Tutorials, references, and examples are regularly checked for mistakes, but we cannot guarantee complete accuracy. By using CodingAsk.com, you agree to our terms of use, cookie, and privacy policy.
Copyright 2010-2024 by Refsnes Data. All Rights Reserved.