Description

The <li> (short for list item) defines an individual list item within a list. Each list item usually rendered with a bullet (in unordered lists, defined by the <ul> tag) or a number or letter (in the case of ordered lists, defined by the <ol> tag). The appearance of bullet or the number can be controlled with the type attribute.

The following table summarizes the usages context and the version history of this tag.

Parent:<ul>, <ol>, <dir>, <menu>
Placement:Block
Content:Block, inline and text
Start/ End Tag:Start tag: required, End tag: required
Version:HTML 2, 3.2, 4, 4.01, 5

Syntax

The basic syntax of the <li> tag is given with:

HTML/XHTML: <li> ... </li>

The example below shows the <li> tag in action.

<ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ul>

Tag-Specific Attributes

The following table shows the attributes that are specific to the <li> tag.

Global Attributes

Like all other HTML tags, the <li> tag supports the global attributes in HTML5.

Event Attributes

The <li> tag also supports the event attributes in HTML5.

Browser Compatibility

Element
<li>YesYesYesYesYes