Tag Description
The li tag is used to define a list item.
The
<li>
tag is used in conjunction with ordered (<ol>
) lists, unordered (<ul>
) lists, and menu lists
(<menu>
).
This tag has the form:
<li>item text</li>
HTML5 and HTML4.01 Differences
The "type" attribute was deprecated in HTML4.01, and is NOT supported in HTML5.
The "value" attribute was deprecated in HTML4.01, but IS supported in HTML5.
Attributes
Attribute | Value | Description |
---|---|---|
type | 1 A a I i disc square circle |
Specifies which kind of bullet point will be used
HTML4:
![]()
HTML5:
![]() |
value | number | Specifies the number of a list item (only within ordered list (<ol> ) element)
HTML4:
![]()
HTML5:
![]() |
Global Attributes
This tag also supports the HTML Global Attributes.
Event Attributes
This tag also supports the HTML Event Attributes.
Examples
The following example shows the basic use of this tag:
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
This produces the following result:
- Item 1
- Item 2
- Item 3
- Item 1
- Item 2
- Item 3
Browser Support
Chrome | Firefox | IE | Safari | Opera |
---|---|---|---|---|
Doctype Declaration Support
The following table lists the doctype declarations this element may appear in:
HTML4.01 / XHTML1.0 | XHTML 1.1 | HTML 5 | ||
---|---|---|---|---|
Traditional | Strict | Frameset | ||
Miscellaneous Information
Defined In: | HTML 2 |
---|---|
Empty Tag: | No |