<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Creating lists in Hypertext Markup Language (HTML)</title>
<META Name="description" lang="en" Content="A guide to adding lists to web pages.">
<META Name="keywords" Content="how to make a web page, learning html,HTML tutorials, guide to HTML">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL="stylesheet" TYPE="text/css" HREF="/styles/standard.css">
</head>
<body>
<div align=center><p><br>
<table class="tableborder" width="600" border="0" cellspacing="0" cellpadding="20">
<tr>
<td>
<!--#include virtual="/inc/top.html" -->
<p>
<!--     end header    -->
<!--   start here to copy sectional path nav   -->

<hr align="left" width="70%">
<a href="../index.html">Handouts</a> &#187;
<a href="index.html">HTML Handouts</a> &#187;
HTML Lists
<hr align="left" width="70%">
<P>
<!--   end sectional nav  -->




<h1>Hypertext Lists</h1>

See also the <a href="css-lists.html">CSS Lists</a> handout.

Lists in hypertext offer the only form of indentation available. Since HTML
and ignores white space, formatting with the space bar of the keyboard
will not provide the layout needed for some documents.
<p>
The list tags can be used with and without their notation (numbers
and bullets) in order to center columns of text. Bear in mind that
"centering" is a relative term and the windows of graphics can be
changed by the reader, resulting in browser windows that vary in
width from a few inches to 10 or more. So you are not really
centering text, though it may appear centered in *your* window. You
are merely indenting the text from the left.
<p>
Here are examples of three HTML list commands along with an approach
that allows you to use bullets of your own making.
<p>



<img src="images/bullet.gif" hspace="10" width="12" height="14"
alt=""><a href="#ol">Ordered (numbered) List</a><br>

<img src="images/bullet.gif" hspace="10" width="12" height="14"
alt=""><a href="#ul">Unordered (bulleted) List</a><br>

<img src="images/bullet.gif" hspace="10" width="12" height="14"
alt=""><a href="#dl">Definition List</a><br>



<p>

<a name="ol"></a>
<h2>An Ordered (numbered) List in HTML</h2>

Use the <b>&lt;ol&gt;</b> tag to create numbered lists in Html. Note that you do not
enter the "numbers" in the lists; the HTML language provides them. You will
merely enter commands to *provide* numbers. The nice feature about the OL
listing is that you don't have to keep track of the numbers themselves; you
can insert and remove entries without screwing up the numbers.
<p>
You can select the type of numbers used with the <strong>type</strong>
designation: <strong>type = =A|a|I|i|1</strong>
<center><b>&lt;ol type=A&gt;</b></center>


<p>

Figure 1 shows an <b>ordered</b> (numbered) list of internet tools
Tools can be divided into roughly two genres: online search tools and
software you run on your local machine.
<p>
<center>

<table border="1" cellpadding="10" cellspacing="0"
summary="This table is used for formatting" width="500"><tr><td>

<h3>Tool Use: On and Off the Net</h3>
<ol>
<li>Online Search Tools
  <ol type=A>
  <li>The Hunt
  <li>Exploration
  </ol>
<li>Local Software
  <ol type=a>
  <li>Telecommunications Software (telewarez)
  <li>HTML Editors
  </ol>
</ol>
</td></tr></table>
<b>Figure 1. A nested, ordered list</b>
</center><p>
Figure 1 displays 2 sets of nested <b>&lt;ol&gt;</b> tags. You can see the
formatted hypertext below:
<p>
<center>

<table border="1" cellpadding="10" cellspacing="0"
summary="This table is used for formatting" width="500"><tr><td>



<b>&lt;h2&gt;</b>Tool Use: On and Off the Net<b>&lt;/h2&gt;</b><br>
<b>&lt;ol&gt;</b><br>
<b>&lt;li&gt;</b>Online Search Tools<br>
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>&lt;ol type=A&gt;</b><br>
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>&lt;li&gt;</b> The Hunt<br>
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>&lt;li&gt;</b> Exploration<br>
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>&lt;/ol&gt;</b><br>
<b>&lt;li&gt;</b>Local Software<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>&lt;ol type=A&gt;</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>&lt;li&gt;</b>Telecommunications Software (telewarez)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>&lt;li&gt;</b>HTML Editors <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>&lt;/ol&gt;</b><br>
<b>&lt;/ol&gt;</b>
</td></tr></table>
<b>Figure 1a. The HTML code for the ordered list in Figure 1.</b>

</center>
<p>

<a href="lists.html"><img src="../../images/top.gif" width="28" height="39"
alt="To the Top" border="0"></a>

<p><br>
<a name="ul"></a>
<h2>An Unordered List With Bullets</h2>
<p>

This is an Unordered list. That means the listed text is indented
from the left margin and tagged with bullets (the asterisk in lynx;
round dots in graphics browsers), rather than being numbered, like
with the <b>&lt;ol&gt;</b>. Begin each line with the <b>&lt;li&gt;</b> tag to place
the bullet. If you *omit* the <b>&lt;li&gt;</b>  tag the line will be
indented but no bullet will be presented. Notice how the following
entries are indented under this paragraph.
<p>
You can choose the appearance of the bulets with the <strong>type
</strong> designation, as in
<center>
&lt;ul type=disk|circle|square&gt;
</center>
<p>
<center>

<table border="1" cellpadding="10" cellspacing="0"
summary="This table is used for formatting" width="500"><tr><td>

<h3>An Unnumbered List Marked with Bullets</h3>
<ul>
<li> An entry in the list.
<li> This is a long entry in the list. This line is so long it will
wrap around, maintaining the indentation. Remember, wrapping is
affected by the width of the *reader's* browser window, so what you
see may not be what other people see.
<li> Here is another entry in the list.
<p>
<li> The &lt;p&gt; tag was inserted above and below this
entry to supply blank lines above and below this entry.<br>
<p>
This entry in the list does NOT begin with <b>&lt;li&gt;</b> tag. It is
indented, just like the other entries; it just doesn't begin with a
<b>&lt;li&gt;</b> tag.		So you don't get the bullet!
</ul>
</td></tr></table>
<b>Figure 2. An Unordered List Marked with Bullets</b>
</center><p><br>
Here is what that list looks like in HTML:

<p>
<center>

<table border="1" cellpadding="10" cellspacing="0"
summary="This table is used for formatting" width="500"><tr><td>


 <b>&lt;h2&gt;</b>An Unnumbered List Marked with Bullets<b>&lt;/h2&gt;</b><br>
 &lt;ul&gt;<br>
 <b>&lt;li&gt;</b> An entry in the list.<br>

 <b>&lt;li&gt;</b>This is a long entry in the list. This line is so long
 it will wrap around, maintaining the indentation. Remember,
 wrapping is affected by the width of the *reader's* browser
 window, so what you see may not be what other people see.<br>

 <b>&lt;li&gt;</b> Here is another entry in the list.<br>

 &lt;p&gt;<br>

 <b>&lt;li&gt;</b>The &lt;p&gt; tag was inserted above and below this entry to<br>
 supply blank lines above and below this entry.<br>

 &lt;p&gt;<br>

 This entry in the list does NOT begin with <b>&lt;li&gt;</b> tag. It is

 indented, just like the other entries; it just doesn't begin
 with a <b>&lt;li&gt;</b> tag.	So you don't get the bullet!<br>
 <b>&lt;/ul&gt;</b>

</td></tr></table>
<b>Figure 2b. The HTML code for the bulleted list.</b>
</center>


<p><br>


<a href="lists.html"><img src="../../images/top.gif" width="28" height="39"
alt="To the Top" border="0"></a>



<p><br>

<a name="dl"></a>
<h2>The HTML Definition List</h2>
<p>
The definition list is a kind of column format and uses 3 tags,
<b>&lt;dl&gt;</b>, <b>&lt;dt&gt;</b> and <b>&lt;dd&gt;</b>. The <b>&lt;dl&gt;</b> opens the list;
<b>&lt;/dl&gt;</b> closes the list. <b>&lt;dt&gt;</b> marks the "term to be defined",
positioning it to the left. The <b>&lt;dd&gt;</b> marks the "definition OF
the term". This text is usually runs about a paragraph in length and appears
indented underneath the "term".


<p>
In this case the <b>&lt;dl&gt;</b> has been entered on the line below
the title (A Definition List on Internet Tools). The <b>&lt;dt&gt;</b> tag is
entered before the 2 terms, Gopher and Veronica (there is no closing tag
for <b>&lt;dt&gt;</b>). The <b>&lt;dd&gt;</b> tag is entered before the definition of
the terms; it has no closing tag either.
<p>
<center>

<table border="1" cellpadding="10" cellspacing="0"
summary="This table is used for formatting" width="500"><tr><td>


<h3>Internet Tools</h3>
<dl>
<dt>Gopher<dd>The earliest document delivery service on the Internet.
Gophers go and get documents and bring
them back to you.

<dt>Veronica<dd>A companion to the Gopher, Veronica allows you to search gopher
tunnels for specific strings of text. Boolean terminology and truncation
are available.

<dt>World Wide Web
   <dd>A global system of document and multimedia distribution, based in
    hypertext and incorporating older net tools (such as telnet and FTP).

</dl>
</td></tr></table>
<b>Figure 3. A List Formatted by Definition Tags</b>
</center><p>
<p>
<h2>Here is the formatted text</h2>

<center>

<table border="1" cellpadding="10" cellspacing="0"
summary="This table is used for formatting" width="500"><tr><td>


 <b>&lt;h2&gt;</b>Internet Tools <b>&lt;/h2&gt;</b><br>
<b>&lt;dl&gt;</b><br>
<b>&lt;dt&gt;</b>Gopher<br>
<b>&lt;dd&gt;</b>The earliest document delivery service on the Internet.
Gophers go and get
documents and bring them back to you.<br>

<b>&lt;dt&gt;</b>Veronica<br>
<b>&lt;dd&gt;</b>A companion to the Gopher, Veronica allows you to
search gopher
tunnels for specific strings of text. Boolean terminology and truncation
are available.<br>

<b>&lt;dt&gt;</b>World Wide Web<br>
   <b>&lt;dd&gt;</b>A global system of document and multimedia distribution, based in
    hypertext and incorporating older net tools (such as telnet and FTP).
<br>
<b>&lt;/dl&gt;</b>
</td></tr></table>
<b>Figure 3b. The HTML code for the definition list</b>
</center><p>
Notice that is doesn't matter whether you enter the <b>&lt;dt&gt;</b> and
<b>&lt;dd&gt;</b> terms on the same line or on separate lines. The browsers will
merge them in together in the correct format.

<p><br>

<a href="lists.html"><img src="../../images/top.gif" width="28" height="39"
alt="To the Top" border="0"></a>




<!-- footer -->
<!--#include virtual="/inc/foot.html" -->
<p>
</td></tr></table>
</div>
<!--#exec cgi="/cgi-bin/looker/ax.pl" -->
</body>
</html>
