html
  1. html-lists

HTML Lists

HTML lists allow web developers to group a set of related items in lists.

There are three types of lists in HTML: unordered lists, ordered lists, and description lists.

Unordered Lists

An unordered list starts with the <ul> tag. Each list item starts with the <li> tag. The list items will be marked with bullets (small black circles) by default. Here is an example of how to create an unordered list in HTML:

<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>
Try Playground

Ordered Lists

An ordered list starts with the <ol> tag. Each list item starts with the <li> tag. The list items will be marked with numbers by default. Here is an example of how to create an ordered list in HTML:

<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ol>
Try Playground

Description Lists

A description list is a list of terms, with a description of each term. The <dl> tag defines the description list, the <dt> tag defines the term (name), and the <dd> tag describes each term. Here is an example of how to create a description list in HTML:

<dl>
  <dt>Term 1</dt>
  <dd>Description 1</dd>
  <dt>Term 2</dt>
  <dd>Description 2</dd>
</dl>
Try Playground

Importance of Lists

  • Lists can be used to group related items and make them easier to read and understand.
  • Lists can be used to organize information in a clear and concise way.
  • Search engines use lists to index the structure and content of web pages.
Published on: