This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The <li> HTML element is used to represent an item in a list. It must be contained in a parent element: an ordered list (<ol>), an unordered list (<ul>), or a menu (<menu>). In menus and unordered lists, list items are usually displayed using bullet points. In ordered lists, they are usually displayed with an ascending counter on the left, such as a number or letter.
<p>Apollo astronauts:</p> <ul> <li>Neil Armstrong</li> <li>Alan Bean</li> <li>Peter Conrad</li> <li>Edgar Mitchell</li> <li>Alan Shepard</li> </ul>
p,
li {
font:
1rem "Fira Sans",
sans-serif;
}
p {
font-weight: bold;
}
This element includes the global attributes.
valueThis integer attribute indicates the current ordinal value of the list item as defined by the <ol> element. The only allowed value for this attribute is a number, even if the list is displayed with Roman numerals or letters. List items that follow this one continue numbering from the value set. This attribute has no meaning for unordered lists (<ul>) or for menus (<menu>).
type Deprecated This character attribute indicates the numbering type:
a: lowercase lettersA: uppercase lettersi: lowercase Roman numeralsI: uppercase Roman numerals1: numbersThis type overrides the one used by its parent <ol> element, if any.
Note: This attribute has been deprecated; use the CSS list-style-type property instead.
For more detailed examples, see the <ol> and <ul> pages.
<ol> <li>first item</li> <li>second item</li> <li>third item</li> </ol>
<ol type="I"> <li value="3">third item</li> <li>fourth item</li> <li>fifth item</li> </ol>
<ul> <li>first item</li> <li>second item</li> <li>third item</li> </ul>
| Content categories | None. |
|---|---|
| Permitted content | Flow content. |
| Tag omission | The end tag can be omitted if the list item is immediately followed by another <li> element, or if there is no more content in its parent element. |
| Permitted parents | An <ul>, <ol>, or <menu> element. Though not a conforming usage, the obsolete <dir> can also be a parent. |
| Implicit ARIA role | listitem when child of an ol, ul or menu |
| Permitted ARIA roles | menuitem, menuitemcheckbox, menuitemradio, option, none, presentation, radio, separator, tab, treeitem |
| DOM interface | HTMLLIElement |
| Specification |
|---|
| HTML> # the-li-element> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
li |
1 | 12 | 1 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
type |
1 | 12 | 1 | ≤12.1 | ≤4 | 18 | 4 | ≤12.1 | ≤3.2 | 1.0 | 4.4 | ≤3.2 |
value |
1 | 12 | 1 | ≤12.1 | ≤4 | 18 | 4 | ≤12.1 | ≤3.2 | 1.0 | 4.4 | ≤3.2 |
<ul>, <ol>, <menu>, and the obsolete <dir>;<li> element: list-style property, to choose the way the ordinal is displayed,margin property, to control the indent of the list item.
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/li