Difference between revisions of "HTML/Elements/ol"

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

Revision as of 21:16, 12 October 2013

<ol>

The <ol> element represents the ordered list.

Point

  • Ordered list:
    • 1. 2. 3.
    • a. b. c.
    • i. ii. iii.

etc.

  • The items of the list are the li element child nodes of the ol element, in tree order. [Example A]

HTML Attributes

  • reversed
    Changes into the descending order list, if present. [Example B]


  • start = valid integer
    Specifies the ordinal value of the first list item. [Example C]


  • type = the kind of marker
    Specifies the kind of marker to use in the list. [Example D]


See also global attributes.

Examples

Example A

[try it]

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

Ol01.png

Example B

With the reversed attribute [try it]:

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

Li02.png

Example C

With the start attribute [try it]:

<ol start="101">
  <li>sample1</li>
  <li>sample2</li>
  <li>sample3</li>
</ol> 

Ol03.png

Example D

With the type attribute [try it]:

<ol type="lower-alpha">
  <li>sample1</li>
  <li>sample2</li>
  <li>sample3</li>
</ol> 

Ol04.png

HTML Reference

The HTML5 specification defines the <ol> element in 4.5.5 The ol element.

See also