Using an HTML List in Web Design

Ordered lists, unordered lists, and definition lists

Grocery List

James Braund/Getty Images

The HTML language supports three different types of list. By default, they use standard tags and render in standard ways, although a more elaborate styling for any of these elements generally requires a style sheet.

Three Types of Lists in HTML

HTML offers three use cases for listing content on a page.

  • Ordered Lists: These are sometimes called numbered lists because, by default, the list items contained in that list have a specific numerical order or ranking. Ordered lists are appropriate where the exact ordering of items are important to the meaning of the content. For example, a recipe would likely use an ordered list because the steps occur in sequence. Any step-by-step process is best presented as an ordered list.
  • Unordered Lists: These are sometimes called bulleted lists because the default visual appearance of an unordered list is to have small bullet icons in front of the list items. This type of list is best used when the order of the items isn't salient. The list items will appear in whatever order you code them in for the HTML, but you are determining that order and, unlike a recipe or step-by-step process, the order could be changed and the meaning of the content would not suffer.
  • Definition Lists: These are lists of items that have two parts, a term to be defined and the definition. They are commonly used to display a definition/description pair like you would find in a dictionary, but definition lists can also be used for many other kinds of content.

Lists in General

html list examples

With lists, all items are paired with opening and closing tags. These pairs govern both the list-type markers and the individual list-item elements.

Ordered Lists

Use the <ol> tag (the ending </ol> tag is required), to create a numbered list with numbers starting at 1. The elements are created with the <li> tag pair. 

The HTML looks like this:

<ol>
<li>Step One</li>
<li>Step Two</li>
<li>Step Three</li>
</ol>

And the result looks like this:

  1. Step One
  2. Step Two
  3. Step Three

Unordered Lists

Use the <ul> tag (the ending </ol> tag is required) to create a list with bullets instead of numbers. Just like with the ordered list, the elements are created with the <li> tag pair.

The HTML looks like this:

<ul>
<li>Apples</li>
<li>Oranges</li>
<li>Pears</li>
</ul>

And the result looks like this:

  • Apples
  • Oranges
  • Pears

Definition Lists

Definition lists create a list with two parts to each entry: the name or term to be defined and the definition. Use <dl> to create the list and use <dt> to specify the term and <dd> to offer the definition.

The HTML looks like this:

<dl>
<dt>Cat</dt>
<dd>Cute four-legged animal.</dd>
<dt>Internet</dt>
<dd>Online community optimized for cat photos.</dd>
</dl>

And the result looks like this:

example of a definition list