Level: 0
HTML supports several types of lists, all of which may be nested:
Level: 0
A definition list (<dl>
)is a list of terms (<dt>
) and corresponding
definitions (<dd>
). Definition lists are typically formatted with the
term in the left wide margin and the definition on one or more
lines to the right of the term.
If the
<dt>
term does not fit in the
<dt>
column (one third of the
display area), it may be extended across the page with the
<dd>
section moved to the next line, or it may be wrapped onto
successive lines of the left hand column.
The
<dt>
and
<dd>
elements should appear in pairs. Single
occurrences of
<dt>
without a subsequent
<dd>
are allowed, and
have the same significance as if the
<dd>
had been present with
no text.
The opening list tag must be
<dl>
. It must be immediately
followed by the first term (<dt>
). For example:
<dl>
<dt>Term<dd>This is the definition of the first term.
<dt>Term<dd>This is the definition of the second term.
</dl>
The definition list type can take the
compact
attribute, which
suggests that a compact rendering be used, because the enclosed
elements are individually small, or the whole list is rather large,
or both.
Unless you provide the compact attribute, HTML leaves white
space between successive
dt
,
dd
pairs.The
compact
attribute may
also reduce the width of the left-hand (dt
) column.
The opening list tag must be
dl compact
. It must be immediately
followed by the first term (dt
). For example:
<dl compact>
<dt>Term<dd>This is the first definition in compact format.
<dt>Term<dd>This is the second definition in compact
format.
</dl>
Level: 0
A directory list (<dir>
) is a list of items containing fewer than 20
characters each. The items in a directory list may be arranged in
columns (typically 24 characters wide). If the rendering software
is able to optimize the column width as function of the widths of
individual elements, so much the better.
The opening list tag must be
<dir>
. It must be immediately
followed by the first list item (<li>
). For example:
<dir>
<li>A-H<li>I-M
<li>M-R<li>S-Z
</dir>
Level: 0
A menu list (<menu>
) is a list of items with typically one line per
item. The menu list style is more compact than the style of an
unordered list.
The opening list tag must be
<menu>
. It must be immediately
followed by the first list item (<li>
). For example:
<menu>
<li> First item in the list.
<li> Second item in the list.
<li> Third item in the list.
</menu>
Level: 0
An ordered list (<ol>
)is a list of items in which the items are
typically numbered in such a way as to indicate the order as
significant.
The opening list tag must be
<ol>
. It must be immediately
followed by the first list item (<li>
). For example:
<ol>
<li>Click the Web button of the OLIAS Launcher.
OLIAS opens the Open URL window.
<li>Enter the URL number in the text field of the Open URL
window.OLIAS displays the Web document you specified.
<li>Click highlighted text to move from one link to another.
</ol>
Level: 0
An unordered list is a list of items that is typically separated by some white space and/or marked by bullets, etc.
The opening list tag must be
ul
. It must be immediately followed
by the first list item (li
). For example:
<ul>
<li> This is the first item in the list.
<li> This is the second item in the list.
<li> This is the third item in the list.
</ul>