<li>...</li>

HTML4 HTML5

Defines a list item.

Both opening and closing tags are required.

Example 1

<ol>
  <li>First</li>
  <li>Second</li>
  <li>Third</li>
  <li>Fourth</li>
</ol>

 The browser will interpret this code as follows:

  1. First
  2. Second
  3. Third
  4. Fourth

Appearance of a list item can be customized using attributes:

value="number" - Defines item ordinal index number,

type="value" - Unsupported in HTML5; defines numbering or bullet style:

Example 2

First list:
<ol>
  <li>First</li>
  <li value="4">Second</li>
  <li>Third</li>
</ol>

Second list:
<ul>
  <li>Pen</li>
  <li type="i" value="5">Fountain pen</li>
  <li type="A">Pencil</li>
  <li type="circle">Crayon</li>
</ul>

 The browser will interpret this code as follows:

First list:
  1. First
  2. Second
  3. Third
Second list:
  • Pen
  • Fountain pen
  • Pencil
  • Crayon

 In the first list, using the value attribute, we modified the second list item's number to 4. The following item received the next sequential number - 6.

In the second list, we modified the second item in the bulleted list. First, we set it to be preceded by a lowercase Roman numeral, and second, we set its value to 5 (roman v).

The third list item was also modified to display an uppercase Latin letter. Since the previous item had a value of 5, this item's number increments by 1 to 6, displaying the 6th letter of the Latin alphabet (F).

The type="circle" attribute on the last list item specifies an open circle bullet.