This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

li – list item

Summary

The li element represents one list item.

Overview Table

DOM Interface
HTMLLIElement

Its parent element may be ol, ul, or menu.

HTML Attributes

  • value = valid integer
    Specifies the ordinal value of the list item.
    The value attribute can be used when the parent element in only a ol element. [Example B]

Examples

This example uses the li element to create individual items in an unordered list.

<ul>
     <li>Art</li>
     <li>History</li>
     <li>Literature</li>
     <li>Sports</li>
     <li>Entertainment</li>
     <li>Science</li>
</ul>

This example uses the li element to create individual items in an ordered list.

<ol>
     <li>First</li>
     <li>Second</li>
     <li>Third</li>
</ol>

Typical browser default CSS properties for the li element.

display: list-item;
margin-left: 40px;

Notes

Remarks

The type attribute values disc, circle, and square apply to unordered lists; the values 1, a, A, i, and I apply to ordered lists. When the li element is absolutely positioned with CSS, the list item marker is not rendered. The default value of the display property for this element is list-item.

Related specifications

HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation
HTML 4.01
W3C Recommendation

See also

Other articles

Attributions