List Tags

or scroll down the page.

Return to Main Page of Ted’s HTML Tutorial

Lists commonly are found in documents, including web pages.  They are an easy and effective way to itemize such things as elements, components, or ingredients.

Words or phrases which need to be set apart from the rest of the body of text can be emphasized with a “bullet” (a heavy dot used for calling attention to a particular section of text).  An empty tag called a “list” tag is used to do this:

Since a list tag is an empty tag (that is, there is no negating counterpart </LI>), and since it indents the text following it, it cannot be alone; otherwise, the entire remainder of the document would be indented.

Therefore, list tags (<LI>) must be incorporated between two non-empty tags.  One such pair of tags is called “unordered list” tags:

The initial <UL> tag may contain within it this parameter as part of the command:
Here, items in an unordered list are accentuated: <FONT SIZE="4"><P>During a routine eye examination, a pathology within the body sometimes can be detected in the eye, especially if the disease process is in a moderate to advanced stage.  Here are 2 such cases, along with their intraocular signs:
<UL TYPE="CIRCLE">
<LI><I>diabetic</I> retinal signs:
<UL TYPE="SQUARE">
<LI>CSME (clinically significant macular edema)
<LI>cotton wool spots (infarcted areas)
<LI>neovascular formation
<LI>blot and dot hemorrhages
</UL>
<LI><I>hypertensive (high blood pressure)</I> retinal signs:
<UL TYPE="SQUARE">
<LI>blood vessel crossing defects (arteries compressing veins)
<LI>exudative changes in and around the macula ("star-burst" pattern)
<LI>hemorrhages
<LI>narrowing of retinal arterioles, including the "boxcar" effect
</UL>
</UL></P></FONT>
and would be marked up like this: During a routine eye examination, a pathology within the body sometimes can be detected in the eye, especially if the disease process is in a moderate to advanced stage.  Here are 2 such cases, along with their intraocular signs:


List tags (<LI>) also may be incorporated within another pair of non-empty tags, called “ordered list” tags:

The initial <OL> tag may contain within it this parameter as part of the command: In an ordered list, the list (<LI>) tag may contain within it this parameter: This is how items in an ordered list may be enumerated:
<FONT SIZE="4"><P>As listed in the <I>Jackson Heights Journal</I>, Jackson Heights Middle School ranked <B>5th</B> in the city-wide achievement test given last week:
<OL TYPE="I">
<LI>Oakfield Middle School
<OL TYPE="A">
<LI>Tod Hastings
<OL TYPE="1">
<LI>Math (#3)
<LI>History (#2)
<LI>Science (#2)
</OL>
<LI>Bonita Chavez
<OL TYPE="1">
<LI>Math (#1)
<LI>History (#4)
<LI>Science (#3)
</OL>
</OL>
<LI>Parkview Mid-High
<OL TYPE="A">
<LI>Jacque Russell
<OL TYPE="1">
<LI>Math (#2)
<LI>History (#5)
<LI>Science (#4)
</OL>
<LI>Dwayne Clancy
<OL TYPE="1">
<LI>Math (#4)
<LI>History (#7)
<LI>Science (#1)
</OL>
</OL>
.<BR>
.<BR>
.<BR>
<LI VALUE="5">Jackson Heights Middle School
<OL TYPE="A">
<LI>Christine Quon
<OL TYPE="1">
<LI>Math (#7)
<LI>History (#6)
<LI>Science (#5)
</OL>
<LI>Roger Dietz
<OL TYPE="1">
<LI>Math (#5)
<LI>History (#8)
<LI>Science (#7)
</OL>
</OL>
</OL></P></FONT>
and would appear like this: As listed in the Jackson Heights Journal, Jackson Heights Middle School ranked 5th in the city-wide achievement test given last week:

  1. Oakfield Middle School
    1. Tod Hastings
      1. Math (#3)
      2. History (#2)
      3. Science (#2)
    2. Bonita Chavez
      1. Math (#1)
      2. History (#4)
      3. Science (#3)
  2. Parkview Mid-High
    1. Jacque Russell
      1. Math (#2)
      2. History (#5)
      3. Science (#4)
    2. Dwayne Clancy
      1. Math (#4)
      2. History (#7)
      3. Science (#1)
    .
    .
    .
  3. Jackson Heights Middle School
    1. Christine Quon
      1. Math (#7)
      2. History (#6)
      3. Science (#5)
    2. Roger Dietz
      1. Math (#5)
      2. History (#8)
      3. Science (#7)


Sometimes, it is helpful to include a glossary of terms in a document, which is accomplished with non-emptydefinition list” tags:

Within the definition list are terms, each marked with an emptydefinition-list term” tag, as well as the actual definitions of the terms, each marked with an emptydefinition-list definition” tag: Here is a short list of common Internet terms:
<DL><FONT SIZE="4">
<DT>HTML
<DD>Hypertext Markup Language
<DT>TP
<DD>Transfer Protocol
<DL>
<DT>FTP
<DD>File Transfer Protocol
<DT>HTTP
<DD>Hypertext Transfer Protocol
</DL>
<DT>URL
<DD>Uniform Resource Locator (= web address)
<DT>WWW
<DD>World Wide Web</FONT>
</DL>
and how this list would look on a browser:
HTML
Hypertext Markup Language
TP
Transfer Protocol
FTP
File Transfer Protocol
HTTP
Hypertext Transfer Protocol
URL
Uniform Resource Locator (= web address)
WWW
World Wide Web

When an enumerated list is required, with each item (“definition”) to be placed on the same line as each number (“term”), a compacted list could be used:

<DL COMPACT><FONT SIZE="4">
<DT>1<DD>HTML
<DT>1<DD>TP
<DT>1<DD>URL
<DT>1<DD>WWW</FONT>
</DL>
and would look this way:
1
HTML
2
TP
3
URL
4
WWW


At times it is beneficial to create a list of related, indented terms which are not preceded by either bullets or numbers.  In such cases, non-emptydirectory list” tags may be used:

The easiest way to understand directory list tags is to see that <DIR> tags indent the text coming after them, while </DIR> tags outdent the text coming after them.  The difference between <DIR> & </DIR> tags and <BLOCKQUOTE> & </BLOCKQUOTE> tags is that directory list tags indent only the left margin of the text between them, whereas blockquote tags indent both the left and right margins of the text between them.

One example of a directory list is the table of contents of an HTML document, where each item in the table of contents is a hyperlink jumping directly to the site listed:

<FONT SIZE="4"><H2>Table of Contents</H2><DIR>
<A HREF="P-I">Part I</A><DIR>
<A HREF="P-I_C-1">Chapter 1</A><DIR>
<A HREF="P-I_C-1_S-A">Section A</A><BR>
<A HREF="P-I_C-1_S-B">Section B</A></DIR>
<A HREF="P-I_C-2">Chapter 2</A><DIR>
<A HREF="P-I_C-2_S-A">Section A</A><BR>
<A HREF="P-I_C-2_S-B">Section B</A></DIR></DIR>
<A HREF="P-II">Part II</A><DIR>
<A HREF="P-II_C-3">Chapter 3</A><DIR>
<A HREF="P-II_C-3_S-A">Section A</A><BR>
<A HREF="P-II_C-3_S-B">Section B</A></DIR>
<A HREF="P-II_C-4">Chapter 4</A><DIR>
<A HREF="P-II_C-4_S-A">Section A</A><BR>
<A HREF="P-II_C-4_S-B">Section B</A></DIR></DIR></DIR></FONT>
and which would look like this when marked up:

Table of Contents

Part I Chapter 1 Section A
Section B
Chapter 2 Section A
Section B
Part II
Chapter 3 Section A
Section B
Chapter 4
Section A
Section B
Note:  The above hyperlinks are not active; they are for demonstration only.  To see how the above list also could be generated using a table, go to the example section of Tables.  How to create hyperlinks will be shown in the section on Hyperlinks.

Proceed to Graphic Images

Return to Main Page of Ted’s HTML Tutorial

Copyright © 1998– by Ted M. Montgomery.  All rights reserved.