leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

HTML list

Estimated reading: 3 minutes 28 views

HTML supports ordered, unordered and definition lists:

Unordered List
This example demonstrates an unordered list.

unordered html link

Ordered List
This example demonstrates an ordered list.

ordered html list

(More examples can be found at the bottom of this page.)

HTML unordered list

An unordered list is a list of items marked with bold dots (typically small black circles).

Unordered lists use <ul> tags<ul>
<li>Coffee</li>
<li>Milk</li>
</ul>

The browser displays the following:

  • coffee
  • Milk

HTML ordered list

Likewise, an ordered list is a list of items, and the list items are labeled with numbers. An ordered list starts with the <ol> tag. Each list item starts with a <li> tag.

List items are marked with numbers.<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>

The browser displays the following:

  1. coffee
  2. Milk

HTML definition list

A definition list is not just a list of items, but a combination of items and their comments.

A definition list begins with a <dl> tag. Each custom list item begins with <dt>. The definition of each definition list item begins with <dd>.<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>

The browser displays the following: coffee- black hot drink Milk- white cold drink

Notes – Helpful Tips

Tip: Paragraphs, line breaks, pictures, links, and other lists can be used inside list items.

more examples

HTML list tag

LabelsDescriptions
<ol>Define an ordered list
<ul>define unordered list
<li>Define list items
<dl>Definition list
<dt>definition list item
<dd>Define a description for a custom list item

ul is the abbreviation of unordered lists (unordered list)

li is short for list item (list item)

ol is an abbreviation for ordered lists (ordered lists)

dl is the English abbreviation of definition lists (custom list)

dt is the abbreviation of definition term (custom list group)

dd is the abbreviation of definition description (custom list description)

nl is the abbreviation of navigation lists (navigation list)

tr is short for table row (a row in a table)

th is an abbreviation for table header cell (the header in the table)

td is short for table data cell (a cell in a table)

Leave a Comment

CONTENTS