HTML CSS Bootstrap Javascript Icons Python
HTML References
HTML - Tag Reference HTML - Tag by Category HTML - Attributes HTML - Global Attributes HTML - Events HTML - Language Codes HTML - Country Codes HTML - URL Encoding HTTP Methods HTTP Status Codes <input> types
All HTML Tags
<!-- --> <!DOCTYPE> <a> <abbr> <acronym> <address> <applet> <area> <article> <aside> <audio> <b> <base> <basefont> <bdi> <bdo> <big> <blockquote> <body> <br> <button> <canvas> <caption> <center> <cite> <code> <col> <colgroup> <data> <datalist> <dd> <del> <details> <dfn> <dialog> <dir> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <font> <footer> <form> <frame> <frameset> <h1> - <h6> <head> <header> <hr> <html> <i> <iframe> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <main> <map> <mark> <meta> <meter> <nav> <noframes> <noscript> <object> <ol> <optgroup> <option> <output> <p> <param> <picture> <pre> <progress> <q> <rp> <rt> <ruby> <s> <samp> <script> <section> <select> <small> <source> <span> <strike> <strong> <style> <sub> <summary> <sup> <svg> <table> <tbody> <td> <template> <textarea> <tfoot> <th> <thead> <time> <title> <tr> <track> <tt> <u> <ul> <var> <video> <wbr>

HTML <ol> tag

The HTML <ol> element is used for creating an ordered list, typically rendered as a numbered list.

Run code

Browser compatibility

The <ol> element is fully supported by all browsers:

Element
<ol> yes yes yes yes yes



Attributes

The following table shows the attributes that are specific to the <ol> tag:

Attribute Value Description
compact compact Not supported in HTML5.
Specifies that the list should render smaller than normal
reversed reversed Indicates whether the list should be displayed in a descending order instead of a ascending
start number Defines the start value of an ordered list
type a
A
i
I
1
Specifies the kind of numbering type to use in the list

  • 'a' indicates lowercase letters,
  • 'A' indicates uppercase letters,
  • 'i' indicates lowercase Roman numerals,
  • 'I' indicates uppercase Roman numerals,
  • '1' indicates numbers (default).

Global Attributes

The <ol> tag supports the global attributes described in HTML Global Attributes Reference

Event Attributes

The <ol> tag supports the event attributes described in HTML Events Reference


More Examples

It is possible to get an ordered list to start with a number other than 1. This is done using the start attribute, which takes a numeric value:

Run code

This example specifies different kind of numbering type to use in the list:

Run code

Nested ordered and unordered list:

Run code

The following example shows how you can change color of the list numbers:

Run code

Last updated: Wednesday 26 Sep, 2018