--- title:
  • slug: Web/HTML/Element/li translation_of: Web/HTML/Element/li original_slug: HTML/Element/li ---

    {{HTMLRef}}

    The HTML <li> elementi, liste nesnesİ için kullanılır. Bir alt element içermelidir: bir sıralı liste ({{HTMLElement("ol")}}), bir sırasız liste ({{HTMLElement("ul")}}) veya bir menü ({{HTMLElement("menu")}}). Menülerde ve sırasız listelerde, listenen ögeler bir 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 categories None.
    Permitted content Flow content.
    Tag omission The end tag can be omitted if the list item is immediately followed by another {{HTMLElement("li")}} element, or if there is no more content in its parent element.
    Permitted parent elements An {{HTMLElement("ul")}}, {{HTMLElement("ol")}}, or {{HTMLElement("menu")}} element. Though not a conforming usage, the obsolete {{HTMLElement("dir")}} can also be a parent.
    DOM interface {{domxref("HTMLLIElement")}}
    Element type Block

    Attributes

    This element includes the global attributes.

    {{htmlattrdef("value")}}
    This integer attribute indicates the current ordinal value of the list item as defined by the {{HTMLElement("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 ({{HTMLElement("ul")}}) or for menus ({{HTMLElement("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.

    {{htmlattrdef("type")}} {{Deprecated_inline}}
    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 {{HTMLElement("ol")}} element, if any.
    Usage note: This attribute has been deprecated: use the CSS {{cssxref("list-style-type")}} property instead.

    Examples

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

    The above HTML will output:

    1. first item
    2. second item
    3. third item
    <ol type="I">
        <li value="3">third item</li>
        <li>fourth item</li>
        <li>fifth item</li>
    </ol>
    

    The above HTML will output:

    1. third item
    2. fourth item
    3. fifth item
    <ul>
        <li>first item</li>
        <li>second item</li>
        <li>third item</li>
    </ul>

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

    Specifications

    Specification Status Comment
    {{SpecName('HTML WHATWG', 'grouping-content.html#the-li-element', '<li>')}} {{Spec2('HTML WHATWG')}}  
    {{SpecName('HTML5 W3C', 'grouping-content.html#the-li-element', '<li>')}} {{Spec2('HTML5 W3C')}}  
    {{SpecName('HTML4.01', 'lists.html#h-10.2', '<li>')}} {{Spec2('HTML4.01')}} The type attribute has been deprecated.

    Browser compatibility

    {{CompatibilityTable}}
    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
    Basic support {{CompatVersionUnknown}} {{CompatGeckoDesktop("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
    Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
    Basic support {{CompatVersionUnknown}} {{CompatGeckoMobile("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}

    See also