10 ListsContents
<li>: The List Item elementThe <li> HTML element is used to represent an item in a list. It must be contained in a parent element: an ordered list (<ol>), an unordered list (<ul>), or a menu (<menu>). In menus and unordered lists, list items are usually displayed using bullet points. In ordered lists, they are usually displayed with an ascending counter on the left, such as a number or letter.
Three Types of Lists in HTMLHTML offers three use cases for listing content on a page.
How to Make Lists in HTMLIn HTML, we can list items either in an ordered or unordered fashion. An ordered list uses numbers or some sort of notation that indicates a series of items. For example, an ordered list can start with number 1, and continue through 2, 3, 4, and so on. Your ordered list can also start with the letter A and go through B, C, D, and so on. Here is an example of an ordered list with students' names and marks. On the other hand, we have unordered lists, like a TODO list for example. Here I am so passionate about coding that I skipped my breakfast 🤓. There is one more type of list called a description list that we will learn as well below. Now let's get into a bit more detail and see how to create each type of list in HTML. |