HTML has two types of lists, ordered and unordered.
An ordered list is a set of numbered items.
Example | Result |
<ol> <li>Step 1 </li> <li>Step 2 </li> <li>Step 3 </li> </ol> |
An ordered list element has the tag <ol>
. This is an abbreviation for Ordered List. Each item in the list is marked by a list item element <li>
. This is an abbreviation for List Item. The list item element is a child element, which means that it goes inside of its parent element, the ordered list (<ol>
).
Making an ordered list has two steps: making the list and adding the list items. To make the ordered list, write the ordered list tags <ol> </ol>
. Next, add your list items inside the ordered list tags. To make each list item, use the list item tags <li> </li>
and write the list item inside the tags.
It can be helpful to indent your<li>
tags so it's clear they are contained in the <ol>
tag.
An unordered list is a set of bulleted items.
Example | Result |
<ul> <li>Red </li> <li>Green </li> <li>Blue</li> </ul> |
An unordered list element has the tag <ul>
. This is an abbreviation for Unordered List. Each item in the list is marked by a list item element <li>
. This is an abbreviation for List Item. The list item element is a child element, which means that it goes inside of its parent element, the unordered list (<ul>
).
Making an unordered list has two steps: making the list and adding the list items. To make the unordered list, write the unordered list tags <ul> </ul>
. Next, add your list items inside the unordered list tags. To make each list item, use the list item tags <li> </li>
and write the list item inside the tags.
It can be helpful to indent your </li>
tags so it's clear they are contained in the <ul>
tag.
W3 Schools Links
Found a bug in the documentation? Let us know at documentation@code.org