HTML Lists
Published Aug 4, 2021Updated Aug 2, 2022
Contribute to Docs
In HTML, lists are used to group pieces of related data together in a certain format. List items are represented by the <li> tag while the lists themselves are represented by the following:
- Ordered lists with items preceded by numbers.
- Unordered lists with items preceded by dots by default.
- Unordered menus with more semantic meaning than
<ul>and user-interactive list items. - Definition lists with terms and details.
Nesting Lists
Lists can be nested, meaning one list of one kind can be placed inside another list of another kind:
<ol><li>Fruits</li><ul><li>Apples 🍎</li><li>Oranges 🍊</li></ul><li>Vegetables</li><ul><li>Tomatoes 🍅</li></ul></ol>
This way, multilevel lists can be created with different indentations.

Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn HTML on Codecademy
- Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
- Includes 34 Courses
- With Professional Certification
- Beginner Friendly.115 hours
- Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.
- Beginner Friendly.7 hours