List Item

Category:HTML Tags

List Item

This tag is used to create a list. The list tag <li> must be contained in an ordered list (<ol> with bullets) or an unordered list (<ul> with numbers).

Examples

Ordered List

Using <li> within an ordered list

<ol>
  <li>Tea</li> 
  <li>Milk</li>
  <li>Water</li>
</ol>

Unordered List

Using <li> within an unordered list

<ul>
  <li>Tea</li>
  <li>Milk</li>
  <li>Water</li>
</ul>

Syntax

<li></li>

Tips

  • Try to indent your </li> tags so it's clear they are contained in the <ul> or <ol> tags.
  • Make sure to start your list with either a <ul> or a <ol>. If you just use <li></li> without <ul> or <ol> the rendered result will be a unordered list with bullet icons preceding each list item.
  • The list items can contain content other than text such as lists of videos, images, songs, or hyperlinks.

Additional Information

For more information, see http://www.w3schools.com/tags/tag_li.asp

Found a bug in the documentation? Let us know at documentation@code.org