Difference between revisions of "HTML/Elements/li"

From W3C Wiki
< HTML‎ | Elements
Jump to: navigation, search
(See also)
m (HTML Reference: Fixed the li section to correctly link to the appropriate HTML5 spec, instead of the HTML root element page)
Line 65: Line 65:
 
== HTML Reference ==
 
== HTML Reference ==
  
The HTML5 specification defines the &lt;li&gt; element in [http://www.w3.org/TR/html5/semantics.html#the-li-element 4.5.7 The li element].
+
The HTML5 specification defines the &lt;li&gt; element in [http://www.w3.org/TR/html5/grouping-content.html#the-li-element 4.5.7 The li element].
  
 
== See also ==
 
== See also ==

Revision as of 21:17, 12 October 2013

<li>

The <li> element represents a list of items.

Point

  • Its parent element is an ol, ul, or menu element, then the element is an item of the parent element's list


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.


Examples

Example A

[try it]

<ol>
  <li>sample1</li>
  <li>sample2</li>
  <li>sample3</li>
</ol>

Li01.png

Example B

With the value attribute [try it]:

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

Li02.png

HTML Reference

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

See also