HTML <li> tag
Updated: 09/12/2023 by Computer Hope
When writing in HTML (hypertext markup language), 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
- First numbered item
- Second numbered item
- Third numbered item
Unordered list
- First bullet point
- Second bullet point
- Third bullet point
Attributes
All HTML tags support standard attributes that define the settings of an HTML element. In addition to the standard settings, the <li> tag has the following unique attributes.
Attribute | Description |
---|---|
value | Designates the value of a list item within an ordered list. |
Deprecated attributes
In addition to the above attributes, the <li> tag had the following deprecated attributes.
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