From W3C Wiki
< HTML‎ | Elements
Jump to: navigation, search


The <li> element represents a list item. It may be used inside <ol>, <ul> or <menu> elements.


By definition, a list of items contains more than one <li> element.

HTML Attributes

value = valid integer 
Specifies the ordinal value of the list item.
The value attribute can be used when the parent element in only a <ol> element. [Example B]

See also global attributes.


Example A

[try it]



Example B

With the value attribute [try it]:

  <li value="3">sample1</li>
  <li value="2">sample2</li>
  <li value="1">sample3</li>


HTML Reference

The HTML5 specification defines the <li> element in 4.5.7 The li element.

See also

HTML Lists