HTML <li> tag

Updated: 10/11/2017 by Computer Hope

HTML li tagWhen writing in HTML, the <li> tag is a block element used to designate a list item. It is found in each entry of both ordered (<ol>) and unordered lists (<ul>), as well as menus (<menu>). The following sections contain information about the <li> tag, including an example of it in use, as well as related attributes and browser compatibility.

Example code

<h3>Ordered List</h3>
<ol>
<li>First numbered item</li>
<li>Second numbered item</li>
<li>Third numbered item</li>
</ol> <h3>Unordered List</h3> <ul>
<li>First bullet point</li>
<li>Second bullet point</li>
<li>Third bullet point</li>
</ul>

Example result

Ordered List

  1. First numbered item
  2. Second numbered item
  3. Third numbered item

Unordered List

  • First bullet point
  • Second bullet point
  • Third bullet point

Attributes

Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows the only current, unique, HTML attribute for the <li> tag, as well as a description.

Attribute Description
value Designates the value of a list item within an ordered list

Deprecated attributes

A deprecated attribute is one that may function currently but is not supported in going forward. While the attribute may work with the current version of HTML, it will eventually be phased out. It is better to avoid using these attributes to help future-proof your website.

Attribute Description
type Designates which type of bullet to use in an unordered list

Compatibility

Internet Explorer Firefox Safari Opera Chrome
All versions All versions All version All versions All versions

Browser, Compatibility, List, Web design terms