Web4College

HTML li tag

HTML li stands for list item. <li> tag takes part in making lists. This tag can be used in ordered or unordered lists.

Example
Try it
<ol>
  <li> Computer </li>
  <li> Laptop </li>
  <li> Tablet </li>
  <li> Chair</li>
 </ol>
  1. Computer
  2. Laptop
  3. Tablet
  4. Chair

Tag Uses

Specific uses of <li> tag

as ordered lists

Ordered lists are used where the order of items is necessary.

For example, the directions or instructions in a recipe where the sequence of instructions is necessary.

Preview Example
Try it

as unordered lists

The unordered lists are used where the order of items is not necessary.

For example, ingredients in a recipe.

Preview Example
Try it

Tag omission

The end tag (</li>) may be omitted.

Global Attributes

All the global attributes are applicable on li element.

Tag Attributes

Attributes that are applicable to <li> tag
value

The value attribute of li tag represents the user visible content of list items.

Example
Try it
<ol> <li value="chair"> </li> </ol>