HTML Lists 📌


HTML lists allow web developers to group a set of related items in lists.


Ordered HTML List

An unordered list starts with the <ol> tag. Each list item starts with the <li> tag. The list items will be marked with bullets (small black circles) by default:

   
<ol>
    <li>Coffee</li>
    <li>Tea</li>
    <li>Milk</li>
</ol>
   
  1. Coffee
  2. Tea
  3. Milk

Unordered HTML List

An unordered list starts with the <ul> tag. Each list item starts with the <li> tag. The list items will be marked with bullets (small black circles) by default:

   
<ul>
    <li>Coffee</li>
    <li>Tea</li>
    <li>Milk</li>
</ul>
   

HTML Description Lists

HTML also supports description lists.A description list is a list of terms, with a description of each term. The<dl> tag defines the description list, the <dt> tag defines the term (name), and the <dd> tag describes each term:

   
<dl>
    <dt>Coffee</dt>
    <dd>-Coffee contains caffeine</dd>
    <dt>Milk</dt>
    <dd>-Milk contains protein</dd>
</dl>
   
Coffee
- black hot drink
Milk
- white cold drink

That's all for this lesson, see you next one.