Search the Catalog
HTML Pocket Reference

HTML Pocket Reference

By Jennifer Niederst
1st Edition January 2000
1-56592-579-3, Order Number: 5793
100 pages, $9.95

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 lists

<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 creates a framed document with two frames, side by side. The number of columns is established by the number of measurements listed in the cols attribute.

<HTML>
   <HEAD>
      <TITLE>Frame Document</TITLE>
   </HEAD>
   <FRAMESET COLS="*,*">
      <FRAME SRC="doc1.html">
      <FRAME SRC="doc2.html">
   </FRAMESET>
   <NOFRAMES>Your browser does not support frames.</NOFRAMES>
</HTML>

Nested frames

You can place one frameset within another as shown in the following example.

<FRAMESET COLS="*,*">
   <FRAME SRC="doc1.html">
   <FRAMESET ROWS="50,150">
      <FRAME SRC="doc2.html">
      <FRAME SRC="doc3.html">
</FRAMESET>

Back to: HTML Pocket Reference


oreilly.com Home | O'Reilly Bookstores | How to Order | O'Reilly Contacts
International | About O'Reilly | Affiliated Companies | Privacy Policy

© 2001, O'Reilly & Associates, Inc.