HTML - OL element (ordered list)

> (World Wide) Web - (W3|WWW) > HyperText markup Language (HTML)

1 - About

The ol element represents an ordered list.

Ordered and unordered lists are rendered in an identical manner except that visual user agents number ordered list items.

In ordered lists, it is not possible to continue list numbering automatically from a previous list or to hide numbering of some list items.

Advertising

3 - Example

3.1 - Simple

<ol> <!-- ol = ordered list -->
    <li>First Element</li> <!-- li = list item -->
    <li>Second Element</li>
    <li>Third Element</li>
</ol>

In ordered lists, it is not possible to continue list numbering automatically from a previous list or to hide numbering of some list items. However,

3.2 - Setting the number of a list item

Authors can reset the number of a list item by setting its value attribute. Numbering continues from the new value for subsequent list items.

<ol>
    <li value="30"> makes this list item number 30.</li>
    <li value="40"> makes this list item number 40.</li>
    <li> makes this list item number 41.</li>
</ol>

web/html/ol.txt ยท Last modified: 2019/02/09 11:29 by gerardnico