Can a list be an element?

  • : The List Item element
  • 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 (
        ), 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.

        Content categoriesNone.
        Permitted contentFlow content.
        Tag omissionThe end tag can be omitted if the list item is immediately followed by another
      • element, or if there is no more content in its parent element.
      • Permitted parentsAn
          ,
            , or element. Though not a conforming usage, the obsolete can also be a parent.
        Implicit ARIA rolelistitem when child of an ol, ul or menu
        Permitted ARIA rolesmenuitem, menuitemcheckbox, menuitemradio, option, none, presentation, radio, separator, tab, treeitem
        DOM interfaceHTMLLIElement
  • Attributes

    This element includes the global attributes.

    value

    This 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 (
        ) or for menus ().

        type

        This character attribute 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

          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

    <ol> <li>first itemli> <li>second itemli> <li>third itemli> ol>

    Ordered list with a custom value

    <ol type="I"> <li value="3">third itemli> <li>fourth itemli> <li>fifth itemli> ol>

    Unordered list

    <ul> <li>first itemli> <li>second itemli> <li>third itemli> ul>

    Specifications

    Specification
    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 ;
        1. CSS properties that may be specially useful to style the
        2. 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.