The HTML element is used to represent an item in a list. It must be contained in a parent element: an ordered list [
- ], an unordered list [
- element, or if there is no more content in its parent element.
- ], or a 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.
None. |
Flow content. |
The end tag can be omitted if the list item is immediately followed by another |
An
|
listitem when child of an ol, ul or menu |
menuitem, menuitemcheckbox, menuitemradio, option, none, presentation, radio, separator, tab, treeitem |
HTMLLIElement |
Attributes
This element includes the global attributes.
valueThis integer attribute indicates the current ordinal value of the list item as defined by the
- 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. The value attribute has no meaning for unordered lists [
- a: lowercase letters
- A: uppercase letters
- i: lowercase Roman numerals
- I: uppercase Roman numerals
- 1: numbers
- ] or for menus [].
This character attribute indicates the numbering type:
This type overrides the one used by its parent
- element, if any.
Note: This attribute has been deprecated; use the CSS list-style-type property instead.
Examples
For more detailed examples, see the
- and
- pages.
Ordered list
first item
second item
third item
Ordered list with a custom value
third item
fourth item
fifth item
Unordered list
first item
second item
third item
Specifications
HTML Standard [HTML] # the-li-element |
Browser compatibility
BCD tables only load in the browser
See also
- Other list-related HTML Elements:
- ,
- , , and the obsolete ;
- CSS properties that may be specially useful to style the
- element:
- the list-style property, to choose the way the ordinal is displayed,
- CSS counters, to handle complex nested lists,
- the margin property, to control the indent of the list item.