Syntax | <LI>...</LI> |
---|---|
Attribute Specifications |
|
Contents | Inline elements, block-level elements (except for LIs used within DIR and MENU, which do not allow block-level elements) |
Contained in | OL, UL, DIR, MENU |
The LI element defines a list item. The element must be contained within DIR, MENU, OL or UL.
Unless used with the deprecated MENU or DIR elements, LI may contain block-level elements, including H2, TABLE, UL, and OL. This allows OL and UL to be nested, as in the following example:
<UL>
<LI>
<H2>HTML Document Type Definitions</H2>
<UL>
<LI><A href="html.dtd">html 2.0</A></LI>
<LI><A href="html32.dtd">html 3.2</A></LI>
<LI><A href="strict.dtd">html 4.0 Strict</A></LI>
</UL>
</LI>
<LI>
<H2>SGML Character Entity References</H2>
<UL>
<LI><A href="htmllat1.ent">latin-1 Entities</A></LI>
<LI><A href="htmlsymbol.ent">symbols and Greek Letters</A></LI>
<LI><A href="htmlspecial.ent">other Special Characters</A></LI>
</UL>
</LI>
</UL>
When used with MENU and DIR, LI may not contain block-level elements, and lists cannot be nested.
The deprecated TYPE attribute of LI suggests the rendering of the list item marker. Possible values are as follows:
Style sheets provide greater flexibility in suggesting list item styles. The list-style property of CSS includes the added abilities to suppress list item markers, use images as markers, and more.
LI's VALUE attribute specifies the number of the list item when used with an OL. The number must be given as an integer, though the list item marker may be rendered in another form (for example, as a Roman numeral). Any LI element following in the same list will take its default sequence number based on the first preceding VALUE attribute. VALUE is deprecated in HTMLá4.0, but no substitute currently exists in CSS.