Last Updated : 12 Jul, 2025
The HTML <ol> tag defines an ordered list. An ordered list can be numerical or alphabetical. It's a fundamental HTML element used for structuring content and providing sequential organization. The numbering format can be customized using attributes like type and start, ensuring flexibility in list presentation.
Syntax:
<ol>
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
</ol>
Accepted attributes:
Attribute Description compact Defines that the list should be compacted. Use CSS instead of thecompact
attribute in HTML5. reversed Defines that the order of the list items should be descending (from high to low). start Defines the starting number or alphabet for the ordered list. type Defines the type of order for the list items. Options include numeric (1, 2, 3...), alphabetic (A, B, C...), lowercase alphabetic (a, b, c...), uppercase Roman numerals (I, II, III...), and lowercase Roman numerals (i, ii, iii...). HTML <ol> Tag Examples
Example 1: In this example, The <ol> tag in HTML creates an ordered list where each item is automatically numbered. here we have created an ordered list of Frontend Technologies.
HTML
<!DOCTYPE html>
<html>
<head>
<title>HTML Ordered Lists</title>
</head>
<body>
<h2>Welcome To GeeksforGeeks</h2>
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>React.Js</li>
</ol>
</body>
</html>
Output:
HTML <ol> Tag Example OutputExample 2: This example The <ol> tag in HTML creates an ordered list. The `reversed` attribute reverses the numbering, start sets the starting number, and `type` defines the numbering style 'i' for Roman numerals.
HTML
<!DOCTYPE html>
<html>
<head>
<title>HTML ol tag</title>
</head>
<body>
<h1 style="color:green;">
GeeksforGeeks
</h1>
<h3>HTML ol tag</h3>
<p>reversed attribute</p>
<ol reversed>
<li>HTML</li>
<li>CSS</li>
<li>JS</li>
</ol>
<p>start attribute</p>
<ol start=5>
<li>HTML</li>
<li>CSS</li>
<li>JS</li>
</ol>
<p>type attribute</p>
<ol type="i">
<li>HTML</li>
<li>CSS</li>
<li>JS</li>
</ol>
</body>
</html>
Output:
HTML <ol> Tag Example Output Supported BrowsersThe browser supported by HTML ol tag are listed below:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4