HTML/Elements/ol

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

<ol>

The <ol> element represents an ordered list.

Point

  • Examples of ordered lists:
    • 1. 2. 3.
    • a. b. c.
    • i. ii. iii.
  • 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

HTML Lists