Name
li — HTML 4.01 | HTML5
Synopsis
<li> . . . </li>
Defines an item in a list. It is used within the ol
, ul
,
menu
, and dir
list elements. (Note that menu
and dir
are deprecated in HTML 4.01. In HTML5,
menu
has been redefined and
dir
has been removed.)
Start/End Tags
HTML: Required/Optional; XHTML: Required/Required
Attributes
Core, Internationalization, Events, HTML5 Global Attributes
type="
format
"
Deprecated. Not in HTML5. Changes the format of the automatically generated numbers or bullets for list items.
Within unordered lists (
ul
), thetype
attribute can be used to specify the bullet style (disc
,circle
, orsquare
) for a particular list item.Within ordered lists (
ol
), the type attribute specifies the numbering style for a particular list item (see options under the ol listing).start="
number
"
Nonstandard. Within ordered lists, you can specify the first number in the number sequence. In the (X)HTML Recommendations, the
start
attribute applies to theol
element, notli
.value="
number
"
Deprecated in HTML 4.01. Included in HTML5. Within ordered lists, specifies an item’s number. Following list items increase from the specified number.
Example
<ol><li>
Preheat oven to 300.</li>
<li>
Wrap garlic in foil.</li>
<li>
Bake for 2 hours.</li>
</ol>
Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.