HTML Code :
<ul>
<li>the first list item</li>
<li>the second list item</li>
<li>the third list item</li>
</ul>
- the first list item
- the second list item
- the third list item
The second kind of list is a numbered list, often called an ordered list. It uses the <ol> and <li> tags.
HTML Code :
<ol>
<li>the first list item</li>
<li>the second list item</li>
<li>the third list item</li>
</ol><br>
- the first list item
- the second list item
- the third list item
Like bulletted lists, you always need to end the list with the </ol> end tag, but the end tag is optional and can be left off.
The third and final kind of list is the definition list.
This allows you to list terms and their definitions.
This kind of list starts with a <dl> tag and ends with </dl>
Each term starts with a <dt> tag and each definition starts with a <dd>.
HTML Code :
<dl>
<dt>the first term</dt>
<dd>its definition</dd>
<dt>the second term</dt>
<dd>its definition</dd>
<dt>the third term</dt>
<dd>its definition</dd>
</dl>
- the first term
- its definition
- the second term
- its definition
- the third term
- its definition
Note that lists can be nested, one within another.
The last HTML Code :
<ol>
<li>the first list item</li>
<li>the second list item
<ul>
<li>first nested item</li>
<li>second nested item</li>
</ul>
</li>
<li>the third list item</li>
</ol>
- the first list item
- the second list item
- first nested item
- second nested item
- the third list item