Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML
    tag

HTML
    tag

Example

Two different ordered list examples:

<

ol

<

li

Coffee

li

<

li

Tea

li

<

li

Milk

li

ol

<

ol

start

=

"

50

"

<

li

Coffee

li

<

li

Tea

li

<

li

Milk

li

ol

Try it »


Browser support

Element
    Yes Yes Yes Yes Yes

    Tag Definition and Usage Notes

      The tag defines an ordered list. The list order is displayed with numbers.

      Use

    1. Use the tag to define list items.


      Tips and Notes

      **Tip: ** You can use CSS for rendering; see CSS Lists.

      **Tip:** For an unordered list, you can use

        tag.


        Differences between HTML 4.01 and HTML5

        The "reversed" attribute is new in HTML5.

        In HTML 4.01 the "compact" attribute was deprecated, and it is not supported in HTML5.


        property

        New: new attribute in HTML5.

        property Value Description
        compact compact Not supported and discouraged in HTML5. Use styles instead. Specifies that the list should render more compactly than normal.
        reversedNew reversed Specifies a descending list (9, 8, 7...)
        start number An integer-valued attribute that specifies the starting value of the list numbering. This attribute was deprecated in HTML 4 but reintroduced in HTML5.
        type
        • a Lowercase English letters for numbering
        • A Uppercase English letters for numbering
        • i Lowercase Roman numerals for numbering
        • I Uppercase Roman numerals for numbering
        • 1 Numbers for numbering (default)
        | Specifies the type of the list. Discouraged. Use styles instead. |

        More examples

        Example

        Setting different list styles (using CSS):

        <
        
        ol
        
        style
        
        =
        
        "
        
        list-style-type:upper-roman
        
        "
        
        <
        
        li
        
        Coffee
        
        li
        
        <
        
        li
        
        Tea
        
        li
        
        <
        
        li
        
        Milk
        
        li
        
        ol
        
        <
        
        ol
        
        style
        
        =
        
        "
        
        list-style-type:lower-alpha
        
        "
        
        <
        
        li
        
        Coffee
        
        li
        
        <
        
        li
        
        Tea
        
        li
        
        <
        
        li
        
        Milk
        
        li
        
        ol

        Try it »

        Example

        Displaying different list styles with CSS:

        ol

        .a

        {

        list-style-type:

        armenian

        ;

        }

        ol

        .b

        {

        list-style-type:

        cjk-ideographic

        ;

        }

        ol

        .c

        {

        list-style-type:

        decimal

        ;

        }

        ol

        .d

        {

        list-style-type:

        decimal-leading-zero

        ;

        }

        ol

        .e

        {

        list-style-type:

        georgian

        ;

        }

        ol

        .f

        {

        list-style-type:

        hebrew

        ;

        }

        ol

        .g

        {

        list-style-type:

        hiragana

        ;

        }

        ol

        .h

        {

        list-style-type:

        hiragana-iroha

        ;

        }

        ol

        .i

        {

        list-style-type:

        katakana

        ;

        }

        ol

        .j

        {

        list-style-type:

        katakana-iroha

        ;

        }

        ol

        .k

        {

        list-style-type:

        lower-alpha

        ;

        }

        ol

        .l

        {

        list-style-type:

        lower-greek

        ;

        }

        ol

        .m

        {

        list-style-type:

        lower-latin

        ;

        }

        ol

        .n

        {

        list-style-type:

        lower-roman

        ;

        }

        ol

        .o

        {

        list-style-type:

        upper-alpha

        ;

        }

        ol

        .p

        {

        list-style-type:

        upper-latin

        ;

        }

        ol

        .q

        {

        list-style-type:

        upper-roman

        ;

        }

        ol

        .r

        {

        list-style-type:

        none

        ;

        }

        ol

        .s

        {

        list-style-type:

        inherit

        ;

        }

        Try it »

        Example

        Nested lists:

        <
        
        ol
        
        <
        
        li
        
        Coffee
        
        li
        
        <
        
        li
        
        Tea
        
        <
        
        ul
        
        <
        
        li

        Black tea

        li

        <

        li

        Green tea

        li

        ul

        li

        <
        
        li
        
        Milk
        
        li
        
        ol

        Try it »


        Global Attributes

          The tag supports global attributes; see the full list in [HTML Global Attributes](/tags/ref-standardattributes.html).

          Event attribute

            The tag supports all [HTML Event Attributes](/tags/ref-eventattributes.html).

            Related Articles

            HTML Tutorial:HTML list