Tag Structures

The examples below show the tag structure for common web page elements. When an attribute appears in the tag, it indicates that the attribute is required.

HTML Document

The standard skeletal structure of an HTML document is as follows:

<HTML>
  <HEAD>
    <TITLE>document title</TITLE>
  </HEAD>
  <BODY>
    contents of document
  </BODY>
</HTML>

Lists

The following are examples of simple lists.

Definition list

<DL>
   <DT>
      <DD>
   <DT>
      <DD>
</DL>

Ordered (numbered) list

<OL>
   <LI>
   <LI>
   <LI>
</OL>

Unordered (bulleted) list

<UL>
   <LI>
   <LI>
   <LI>
</UL>

Nested list

<OL>
   <LI>
   <LI>
      <UL>
         <LI>
         <LI>
      </UL>
</OL>

Linking Within a Document

The first <a> tag specifies a named fragment; the second <a> tag links back to that named fragment.

<A NAME="fragmentname">Text</A>
...
<A HREF="#fragmentname">Link to Text</A>

Client-Side Imagemap

In the example below, the image graphic.gif is an imagemap that contains two clickable areas and uses the client-side imagemap named map1.

<MAP NAME="map1">
        <AREA SHAPE="rect" COORDS="123,20,234,40"
        HREF="http://www.oreilly.com/">
        <AREA SHAPE="circ" COORDS="111,50,25" 
        HREF="index.html">
</MAP>

<IMG SRC="graphic.gif" USEMAP="map1">

Basic Table

The following HTML sample shows the basic structure for a simple four-cell table. The number of columns is determined by the number of cells (<td>) that appear within each row (<tr>). The table in the example below has two rows and two columns.

<TABLE>
   <TR>
      <TD></TD>
      <TD></TD>
   </TR>
   <TR>
      <TD></TD>
      <TD></TD>
   </TR>
</TABLE>

Framed Document

The following code ...

Get HTML Pocket Reference, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.