HTML li tag

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

Example

<ol>
  <li> Computer </li>
  <li> Laptop </li>
  <li> Tablet </li>
  <li> Chair</li>
 </ol>
Try </>

Specific Uses

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.

Example

  1. Blend all ingredients together
  2. Add whipped cream and any other toppings you like.
Try </>

as unordered lists

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

For example, ingredients in a recipe.

Example

  • 2/3 cups of ice
  • 2/3 cups of milk
  • 2 tbsp raspberry syrup
  • 2 tbsp vanilla syrup
  • 2 scoops vanilla bean ice cream
Try </>

Related tags

TagsDescription
<ol> This attribute contains the address or URL of the other pages.
<ol> <li> list item of ordered list </li> </ol>
<ul> This attribute contains the address or URL of the other pages.
<ul> <li> list item of unordered list </li> </ul>

Tag omission

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

Global Attributes

All the global attributes are applicable on li element.

Specific Attributes

AttributesDescription
value The value attribute of li tag represents the user visible content of list items.
<ol> <li value="chair"> </li> </ol>


Was this article helpful?

 

Email:

Message:

Get the newsletter