Skip to main content

HTML Lists

HTML lists let you group a set of related items together.

Example

An unordered list and an ordered list.

Prompt
A page with an unordered list of four items labeled "Item" and an ordered list with First item, Second item, Third item, Fourth item.
Output: complete HTML page

Unordered HTML List

An unordered list starts with the <ul> tag, and each item starts with the <li> tag. By default the items are marked with bullets (small black circles).

Example

A bulleted list of drinks.

Prompt
An unordered list (ul) with three list items: Coffee, Tea, Milk, shown with bullet points.
Output: complete HTML page

Ordered HTML List

An ordered list starts with the <ol> tag, and each item starts with the <li> tag. By default the items are marked with numbers.

Example

A numbered list of drinks.

Prompt
An ordered list (ol) with three list items: Coffee, Tea, Milk, shown with numbers.
Output: complete HTML page

HTML Description Lists

A description list is a list of terms with a description for each. The <dl> tag defines the list, the <dt> tag defines each term, and the <dd> tag describes it.

Example

A description list of drinks and what they are.

Prompt
A description list (dl) of terms and descriptions: Coffee - black hot drink, Milk - white cold drink, using dt for terms and dd for descriptions.
Output: complete HTML page

HTML List Tags

The list-related tags are: <ul> (an unordered list), <ol> (an ordered list), <li> (a list item), <dl> (a description list), <dt> (a term in a description list), and <dd> (the description of the term).