Advertisement
❮ Previous: HTML Tables Next: HTML Block and Inline Elements ❯

HTML Lists

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

The HTML have three ways for specifying lists of information. All lists must contain one or more list elements.


HTML Unorder Lists

An unordered list is a collection of related items that have no special order or sequence.

This list is created by using HTML <ul> tag.

Each item in the list is marked with a bullet.

This example shows how to create unordered lists:

Example

<ul>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ul>

Try this code ❯

Read more about <ul> tag.


HTML Ordered Lists

Ordered lists used to define an ordered or numbered list of items.

The numbering style comes in many forms, including letters, Roman numerals, and regular numerals.

This example shows how to create ordered lists:

Example

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

Try this code ❯

Read more about <ol> tag.


Advertisement

HTML Definition Lists

The HTML and XHTML supports a list style which is called definition lists where entries are listed like in a dictionary or encyclopedia.

The definition list is the ideal way to present a glossary, list of terms, or other name/value list.

Example

<dl>
  <dt>Apple</dt>
  <dd>A hard, round fruit with a smooth green, red or yellow skin</dd>
  <dt>Banana</dt>
  <dd>A curved fruit with yellow skin that grows in hot countries</dd>
  <dt>Manogo</dt>
  <dd>A tropical fruit that has a yellow and red skin and is yellow inside</dd>
</dl>

Try this code ❯

Read more about <dl> tag.

Tags Description
<dd> Defines the definition of a term within a list of defined terms <dt> enclosed by a definition list <dl>.
<dl> Defines contains a list of terms and definitions.
<dt> Defines a definition list term in a list of terms and definitions.
<li> specifies a list item as contained in an ordered list <ol>, unordered list <ul>.
<ol> Defines an ordered or numbered list of items.
<ul> Defines unordered list, namely a collection of items that does not have a numerical ordering.

Note: A complete list of all HTML tags, see HTML Tag Reference.

❮ Previous: HTML Tables Next: HTML Block and Inline Elements ❯
Advertisement