HTML lister

HTML understøtter ordnede, uordnede og definerede lister

Eksempler

Uordnet liste
Dette eksempel viser en uordnet liste.
Ordnede lister
Dette eksempel viser en ordnet liste.

Flere eksempler kan findes i bunden af denne side。)

Uordnet liste

En uordnet liste er en liste over elementer, hvor elementerne er markeret med federe cirkler (typisk små sorte cirkler).

En uordnet liste begynder med <ul>-tagget. Hver listeemne begynder med <li>.

<ul>
<li>Coffee</li>
<li>Milk</li>
</ul>

The browser displays as follows:

  • Coffee
  • Milk

Paragraphs, line breaks, images, links, and other lists, etc. can be used within list items.

Ordnede lister

Similarly, ordered lists are also a list of items, and list items are marked with numbers.

Ordered lists start with the <ol> tag. Each list item starts with the <li> tag.

<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>

The browser displays as follows:

  1. Coffee
  2. Milk

Paragraphs, line breaks, images, links, and other lists, etc. can be used within list items.

Definition list

Custom lists are not just a list of items, but a combination of items and their annotations.

Custom lists start with the <dl> tag. Each custom list item starts with <dt>. Each definition of a custom list item starts with <dd>.

<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>

The browser displays as follows:

Coffee
Black hot drink
Milk
White cold drink

List items within a definition list can use paragraphs, line breaks, images, links, and other lists, etc.

More examples

Different types of unordered lists
This example demonstrates a unordered list.
Different types of ordered lists
This example demonstrates different types of ordered lists.
Nested list
This example demonstrates how to nest lists.
Nested list 2
This example demonstrates more complex nested lists.
Definition list
This example demonstrates a definition list.

List tags

Tag Description
<ol> Define ordered lists.
<ul> Define unordered lists.
<li> Define list items.
<dl> Define the definition list.
<dt> Define the definition item.
<dd> Define the description of the definition.
<dir> Discontinued. Use <ul> instead.
<menu> Discontinued. Use <ul> instead.