HTML <li> tag

Updated: 11/13/2018 by Computer Hope
HTML li tag

When 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>), and menus (<menu>). The following sections contain information about the <li> tag, including an example of it in use, and related attributes and browser compatibility.

Example of <li> 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, and 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

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

Browser, Compatibility, Container tag, List, Web design terms