In the above example, you can see we have added an ordered list inside another ordered list. In this case, the list item of the outer ordered list also includes an ordered list. Similarly, we can also mix list types while nesting and add an unordered list inside the ordered list. For ...
sequential order. Each item is represented by the<li>(list item) element, and the browser automatically numbers the items in the list. Ordered lists are perfect for instructions, steps, ranking, or any data where order matters.
Example <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> Try it Yourself » Ordered HTML Lists - The Type AttributeA type attribute can be added to an ordered list, to define the type of the marker:TypeDescription type="1" The list items will be numbered with numbers...
Control List Counting By default, an ordered list will start counting from 1. If you want to start counting from a specified number, you can use thestartattribute: Example <olstart="50"> <li>Coffee</li> <li>Tea</li> <li>Milk</li> ...
The<ol>tag is used to create ordered lists. Similar to unordered lists, each item in the ordered list must be a<li>tag. For example, <ol><li>Ready</li><li>Set</li><li>Go</li></ol> Browser Output Here, you can see list items are represented with numbers to represent a certain...
In the following example, we are nesting an unordered list within an ordered list. <!DOCTYPE html><html><head><title>HTML List</title></head><body><h2>Example of HTML Nested List</h2><ol><li>Item One</li><li>Item Two<ul><li>Subitem A</li><li>Subitem B</li></ul></li><li...
An unordered list (default)An unordered list with disc bulletsAn unordered list with circle bulletsAn unordered list with square bulletsAn unordered list without bulletsAn ordered list (default)An ordered list with numbersAn ordered list with lettersAn ordered list with lowercase lettersAn ordered lis...
{list-style-type:lower-alpha;}</style></head><body><p>Exampleofunordered lists:</p><ulclass="a"><li>语文</li><li>数学</li><li>英语</li></ul><ulclass="b"><li>语文</li><li>数学</li><li>英语</li></ul><p>Exampleofordered lists:</p><olclass="c"><li>语文</li><li...
<ol>标签是一个有序列表容器(orderedlist),会在内部的列表项前面产生数字编号。列表项的顺序有意义时,比如排名,就会采用这个标签: <ol><li>列表项 A</li><li>列表项 B</li><li>列表项 C</li></ol> 上面代码会在列表项 A、B、C 前面,分别产生1、2、3的编号: ...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Ordered List Example</title> </head> <body> <h2>购物清单</h2> <ol> <li>苹果</li> <li>香蕉</li> <li>橙子</li> </ol> </body> </html> 在这个例子中,购物清单被表示为一个有序列表,包含了三个项目:苹...