We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

<li> Redirect 1


The HTML List item element (<li>) is used to represent a list item. It should be contained in an ordered list (<ol>), an unordered list (<ul>) or a menu (<menu>), where it represents a single entity in that list. In menus and unordered lists, list items are ordinarily displayed using bullet points. In ordered lists, they are usually displayed with some ascending counter on the left such as a number or letter

  • Content categories None.
  • Permitted content Flow content.
  • Tag omission The end tag can be omitted if it is immediately followed by another <li> element or if there is no more content in its parent element.
  • Permitted parent elements An <ul>, <ol> or <menu> element. Though not a non-conforming usage, the obsolete <dir> may also be a parent.
  • DOM interface HTMLLIElement


This element includes the global attributes.

This integer attributes indicates the current ordinal value of the item in the list 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. The value attribute has no meaning for unordered lists (<ul>) or for menus (<menu>).
Note: This attribute was deprecated in HTML4, but reintroduced in HTML5.

Note: Prior to Gecko 9.0, negative values were incorrectly converted to 0. Starting in Gecko 9.0 all integer values are correctly parsed.

This character attributes indicates the numbering type:
  • a: lowercase letters
  • A: uppercase letters
  • i: lowercase Roman numerals
  • I: uppercase Roman numerals
  • 1: numbers
This type overrides the one used by its parent <ol> element, if any.
Usage note: This attribute has been deprecated: use the CSS list-style-type property instead.


    <li>first item</li>
    <li>second item</li>
    <li>third item</li>

The above HTML will output:

  1. first item
  2. second item
  3. third item
    <li>first item</li>
    <li>second item</li>
    <li>third item</li>
  • first item
  • second item
  • third item

For more detailed examples, see the <ol> and <ul> pages.


Specification Status Comment
WHATWG HTML Living Standard Living Standard  
HTML5 Candidate Recommendation  
HTML 4.01 Specification Recommendation  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)

See also

  • Other list-related HTML Elements: <ul>, <li>, <menu> and the obsolete <dir>;
  • CSS properties that may be specially useful to style the <li> 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.

Document Tags and Contributors

Last updated by: Sheppy,