HTML lists enable web developers to organize a collection of interconnected items into list structures.
Example
An unordered HTML list: |
An ordered HTML list: |
• Item |
1. First item |
• Item |
2. Second item |
• Item |
3. Third item |
• Item |
4. Fourth item |
A bulleted list begins with the <ul> tag, and each item in the list is initiated with the <li> tag.
By default, list items are indicated with small black circles as bullets.
Example
<ul> |
To begin an ordered list, use the <ol> tag, with each item delineated by the <li> tag.
By default, list items are numbered sequentially.
Example
<ol> |
HTML also accommodates description lists, which consist of terms alongside their corresponding descriptions.
The <dl> tag denotes the description list, with each term defined by the <dt> tag and its description provided by the <dd> tag.
Example
<dl> |