One ordered (<ol>) and one unordered (<ul>) HTML list:
More "Try it Yourself" examples below.
The <li> tag defines a list item.
The <li> tag is used in ordered lists(<ol>), unordered lists (<ul>), and in menu lists (<menu>).
Element | |||||
---|---|---|---|---|---|
<li> | Yes | Yes | Yes | Yes | Yes |
The "type" attribute is NOT supported in HTML5.
The "value" attribute was deprecated in HTML 4.01, but IS supported in HTML5.
Tip: Use CSS to define the type of list.
Attribute | Value | Description |
---|---|---|
type | 1 A a I i disc square circle |
Not supported in HTML5. Specifies which kind of bullet point will be used |
value | number | Specifies the value of a list item. The following list items will increment from that number (only for <ol> lists) |
The <li> tag also supports the Global Attributes in HTML.
The <li> tag also supports the Event Attributes in HTML.
A nested list
A list inside a list.
Another nested list
A more complicated nested list.
HTML tutorial: HTML Lists
HTML DOM reference: Li Object
Most browsers will display the <li> element with the following default values: