HTML Lists
The most common HTML lists are ordered and unordered lists:
HTML Lists
An ordered list:
|
An unordered list:
|
HTML Unordered Lists
An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.
The list items are marked with bullets (typically small black circles).
<li>Coffee</li>
<li>Milk</li>
</ul>
How the HTML code above looks in a browser:
- Coffee
- Milk
HTML Ordered Lists
An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.
The list items are marked with numbers.
<li>Coffee</li>
<li>Milk</li>
</ol>
How the HTML code above looks in a browser:
- Coffee
- Milk
HTML Description Lists
A description list is a list of terms/names, with a description of each term/name.
The <dl> tag defines a description list.
The <dl> tag is used in conjunction with <dt> (defines terms/names) and <dd> (describes each term/name):
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
How the HTML code above looks in a browser:
- Coffee
- – black hot drink
- Milk
- – white cold drink
HTML List Tags
Tag | Description |
---|---|
<ol> | Defines an ordered list |
<ul> | Defines an unordered list |
<li> | Defines a list item |
<dl> | Defines a description list |
<dt> | Defines a term/name in a description list |
<dd> | Defines a description of a term/name in a description list |
5,215 total views, 1 views today