The <ol> HTML/xHTML tag

The Ordered List <ol> tag creates a list that may contain a number of list items / elements (<li></li>).

In normal text in a visual browser, an ordered list will render as a stacked list, similar to an unordered list, but with numbered or lettered items instead of simple bullets.

When to use the <ol> tag (semantic use)

Use ordered lists wherever you have a sequence of related items that deserves to be described as a list, and whose order is significant.

When is order significant? One example is my top ten list below. Another may be when you say, “There are 3 good reasons for using semantic HTML..” and then go on to state those reasons in a list. The ordering there helps the reader keep track of where they are in the list. There are lots more applications in legal, scientific, and other formal types of content.

Do not use an when the order of elements is not important. Use an unordered list (<ul> ) instead.

The tag is valid in all current versions of HTML and xHTML, and it should always have a closing </ol> tag.

An ordered list may contain only list item (<li></li>) tags, but these may contain other content and HTML elements.

Example of <ol> tag use

Here’s a simple example. The style=”list-style:roman;” tells the list to display with regular decimal numbers. Here’s a full list of other list-style options.

<ol id=”topTenFaves” style=”list-style:roman;”>
<li>Web Design from Scratch</li>
<li>A List Apart</li>
<li>Google</li>
<li>UseIt.com</li>
<li>digg.com</li>
<li>del.icio.us</li>
<li>Save the Pixel</li>
<li>Basecamp</li>
<li>Slashdot</li>
<li>Smashing Magazine</li>
</ol>

Looks like…

  1. Web Design from Scratch
  2. A List Apart
  3. Google
  4. UseIt.com
  5. digg.com
  6. del.icio.us
  7. Save the Pixel
  8. Basecamp
  9. Slashdot
  10. Smashing Magazine

Alternatives to the <ol> tag

You may also consider using:

Unrdered lists
Use a <ul> tag where the order of items is not significant.
Definition lists
Use a <dl> where the list is comprised entirely of pairs of elements, with a title or name together with a description or definition.

Make Better Web Pages!

How to make your web site sell - use my secrets

Find out How

Do you love our approach to crafting simple & effective web sites that just work for people?

We'd love to hear about your web strategy.

Contact one of our team today!

Leave a comment

Articles + tutorials in Articles

HTML <tfoot> table foot Tag Reference
The tfoot HTML tag means table foot, and defines the foot section of a table.
HTML <thead> table head Tag Reference
The thead HTML tag means table head, and is an optional tag which can enclose the top row of a table to define the cells as column headers.
HTML <applet> Applet Tag Reference
The applet HTML tag means Applet, and it defines an applet embedded in a webpage.
HTML <strike> Strikethrough Tag Reference
The s or strike HTML tags mean Strikeout, and they are used to display text with a solid line through it.
HTML <big> Big Tag Reference
The big HTML tag means Big, and it is used to do display text in a bigger font size than the default.
HTML <a> anchor Tag Reference
The <a> HTML tag creates an anchor in your HTML code, most commonly providing a link to another site, page, or point on a page.
HTML <small> Small Tag Reference
The small HTML tag means Small, and it is used to display text in a smaller font size than the default.
HTML <dir> Directory List Tag Reference
The dir HTML tag means Directory List, and it defines a directory list.
HTML <span> inline span Tag Reference
The span HTML tag means inline span, and is used to apply style to a section of text without breaking the flow of the document.
HTML <tbody> table body Tag Reference
The tbody HTML tag means table body, and contains the rows of data that make up a table.
HTML <kbd> Keyboard Input Tag Reference
The kbd HTML tag means Keyboard Input, and it defines sample code to be input by the user.
HTML <ul> Unordered List Tag Reference
The ul HTML tag creates an unordered list of items.
HTML <blink> Blink Tag Reference
The blink HTML tag means Blink, and it makes text blink on and off repeatedly.
HTML <p> Paragraph Tag Reference
The p HTML tag means paragraph, and it denotes a paragraph of text.
HTML <> Italic Tag Reference
The i HTML tag means Italic, and renders text in italics.
HTML <var> computer code variable Tag Reference
The var HTML tag means variable, and it denotes variable references within computer programs etc.
HTML <dl> Definition List Tag Reference
The dl HTML tag means "definition list" and is used to create a list of name/description pairs.
HTML <menu> Menu List Tag Reference
The menu HTML tag means Menu List, and it defines a list as a menu list.
HTML <basefont> Basefont Tag Reference
The basefont HTML tag means Basefont, and it defines a default font style.
HTML <div> division Tag Reference
The div HTML tag means division, and is basically a general-purpose box that takes up the full width of the space it's in.
HTML <td> table data cell Tag Reference
The td HTML tag means table data cell, and it's the building block of a table.
HTML <samp> Sample Output Tag Reference
The samp HTML tag means Sample Output, and it defines text as sample output from scripts or programs.
HTML <dt> Definition Term Tag Reference
The dt HTML tag stands for "definition term", used as part of HTML definition lists, together with definitions.
HTML <head> Head Tag Reference
The head tag contains the non-visible information about your HTML document.
HTML <tr> table row Tag Reference
The tr HTML tag means table row, and defines a row of data within a table
HTML <u> underline Tag Reference
The underline HTML tag means underline, and it underlines text.
HTML <caption> Table Caption Tag Reference
The caption HTML tag creates a caption for a table, which is like a heading for a table.
HTML <li> List Item Tag Reference
The li HTML tag means "list item". It indicates an elements in a list
HTML <dd> Definition Definition Tag Reference
The dd HTML tag stands for "definition definition"
HTML <col> column Tag Reference
The col HTML tag means column, and it is used to apply certain styles to a whole column in a table.
HTML <ol> Ordered List Tag Reference
The ol HTML tag means "Ordered List"
HTML <th> table header cell Tag Reference
The th HTML tag means table header cell, and defines a column or row header cell.
HTML <br> Line Break Tag Reference
The br HTML tag means line-break, and it inserts a break into a line of text.
HTML <center> Center Tag Reference
The center HTML tag means Center, and it centres its enclosed content.
HTML <table> table Tag Reference
The table HTML tag means table, and it divides content up into rows and columns.
HTML <b> Bold Tag Reference
The b HTML tag means Bold, and renders text as bold.
HTML <font> Font Tag Reference
The font HTML tag means Font, and it specifies the font style of any text it encloses.
HTML <address> Address Tag Reference
The address HTML tag means Address, and is used to define contact details.
HTML <isindex> Is Index Tag Reference
The isindex HTML tag means Is Index, and it displays a single-line textbox, which prompts the user to enter keywords, which are then used to perform a search.
HTML <colgroup> Column group Tag Reference
The colgroup HTML tag represents a column group, and it's used to apply certain styles (usually using CSS classes) to a sequential group of columns in an HTML table.
HTML <marquee> Marquee Tag Reference
The marquee HTML tag means Marquee, and it makes text scroll across the page from right to left.
A-Z List of HTML Tags
Complete HTML/xHTML Tag Reference (39/88 tags documented)
HTML Heading Tag Reference
The h1 - h6 HTML tags mean Heading 1 to Heading 6, and they denote section headings.
Complete HTML/xHTML Tag Reference
© Scratchmedia Limited, 2006-2010
Floor 3, 111 Buckingham Palace Road, London, SW1W 0WQ, UK
+44 (0)207 1600 989