- HTML Tutorial
- HTML - Home
- HTML - Introduction
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Headings
- HTML - Paragraphs
- HTML - Fonts
- HTML - Blocks
- HTML - Style Sheet
- HTML - Formatting
- HTML - Quotations
- HTML - Comments
- HTML - Colors
- HTML - Images
- HTML - Image Map
- HTML - Iframes
- HTML - Phrase Elements
- HTML - Meta Tags
- HTML - Classes
- HTML - IDs
- HTML - Backgrounds
- HTML Tables
- HTML - Tables
- HTML - Headers & Caption
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML Color Names & Values
- HTML - Color Names
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Picker
- HTML References
- HTML - Cheat Sheet
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - <ol> Tag
HTML <ol> tag is used to create an ordered list. The default order of the ordered list is numerical.
Ordered-list items are displayed as numbers, that can be in various forms, like a numeric, alphabetic(uppercase or lowercase), or romanic. The order list contains the multiple <li> tags that used to create list items.
Syntax
<ol>.....</ol>
Attribute
HTML ol tag supports Global and Event attributes of HTML. Accept some specific attributes as well which are listed below.
Attribute | Value | Description |
---|---|---|
reversed | reversed | Specifies the order lis in reverse order. |
start | number | Specify the starting number of order list. |
type | 1 A a I i |
Specify the order type of the order list. |
Examples of HTML ol Tag
Bellow examples will illustrate the usage of ol tag. Where, when and how to use ol tag. How to create nested ordered list as well.
Creating an Ordered List
In the following example, we are creating an ordered list to display the related list of items.
<!DOCTYPE html> <html lang="en"> <head> <title>HTML ol Tag</title> </head> <body> <!-- Creating an Ordered list--> <h3> List of technologies for Basic Web Development </h3> <ol> <li>HTML</li> <li>CSS</li> <li>JavaScript</li> </ol> </body> </html>
Self Defining Starting Number of order list
Following is another example of the ordered list. Here, we are using the start attribute within the <ol> tag to display the list of items that started the counting number from 10.
<!DOCTYPE html> <html lang="en"> <head> <title>HTML ol Tag</title> </head> <body> <!-- Creating an Ordered list--> <h3> List of technologies for Basic Web Development </h3> <ol start="2"> <li>HTML</li> <li>CSS</li> <li>JavaScript</li> </ol> </body> </html>
Alphabetic Ordered List
In this example, we are using the type attribute within the <ol> tag to sets the numbering type of the list of items in uppercase and lowercase letters format.
<!DOCTYPE html> <html lang="en"> <head> <title>HTML ol Tag</title> </head> <body> <!-- Creating an Ordered list--> <!--type = 'a'--> <ol type='a'> <li>Apple</li> <li>Banana</li> <li>Orange</li> </ol> <!--type = 'A'--> <ol type='A'> <li>Red</li> <li>Black</li> <li>Blue</li> </ol> </body> </html>
Romanic Ordered List
In this program, we are using the type attribute within the <ol> and giving the value type as āIā and āiā to display the list of items in the lowercase and uppercase Roman numerals format.
<!DOCTYPE html> <html lang="en"> <head> <title>HTML ol Tag</title> </head> <body> <!-- Creating an Ordered list--> <!--type = 'i'--> <ol type='i'> <li>HTML</li> <li>CSS</li> <li>JavaScript</li> </ol> <!--type = 'I'--> <ol type='I'> <li>Java</li> <li>PHP</li> <li>Python</li> </ol> </body> </html>
Nested Ordered List
In the following example, we are creating the nested ordered list to display the related items of the ordered list.
<!DOCTYPE html> <html lang="en"> <head> <title>HTML ol Tag</title> </head> <body> <!-- Creating an Nested Ordered list--> <ol start=10> <li>Uppercase letters numbering type</li> <ol type='A'> <li>Mango</li> <li>Apple</li> </ol> <li>Lowercase letters numbering type</li> <ol type='a'> <li>Red</li> <li>Blue</li> </ol> <li>Lowercase roman numerals type</li> <ol type='i'> <li>HTML</li> <li>CSS</li> </ol> <li>Uppercase roman numerals type</li> <ol type='I'> <li>Java</li> <li>C++</li> </ol> </ol> </body> </html>
Supported Browsers
Tag | |||||
---|---|---|---|---|---|
ol | Yes | Yes | Yes | Yes | Yes |