BUY THIS BOOK

Safari Books Online

What is this?

Looking to Reprint this content?


HTML Pocket Reference
HTML Pocket Reference, Second Edition By Jennifer Niederst Robbins
January 2002
Pages: 104

Cover | Table of Contents


Table of Contents

Chapter 1: HTML Pocket Reference
This pocket reference provides a concise, yet thorough, listing of HTML tags and attributes specified by the W3C HTML 4.01 Specification, Netscape Navigator, and Internet Explorer.
The majority of this reference is an alphabetical listing of tags and their attributes with explanations and browser support information.
Section 1.2 lists tags that are related in functionality, and Section 1.3 provides examples of how standard web page elements are constructed.
At the end of the book are useful charts, including character entities and decimal to hexadecimal conversions.
More in-depth explanations of HTML and web design can be found in O'Reilly & Associates' Web Design in a Nutshell by Jennifer Niederst and HTML and XHTML: The Definitive Guide by Chuck Musciano and Bill Kennedy. Also useful is Webmaster in a Nutshell by Stephen Spainhour and Robert Eckstein.
The browser support information in this book was provided by the HTML Compendium created by Ron Woodall. I encourage you to check out the Compendium's site (http://www.htmlcompendium.org) for extremely in-depth explanations of HTML tags, attributes, and values and the browsers that support them.
The correct syntax appears to the right of each tag and indicates whether the tag is a container (with an end tag) or stands alone. Browser support information is indicated below each tag. Browsers that do not support the tag have a line drawn through them. Attribute support is indicated in italics in the attribute description.
The following lists group HTML tags by similar function. See the Section 1.4 section for complete descriptions of each tag.
The following tags are used primarily to give the document structure.
<!DOCTYPE>
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Introduction
This pocket reference provides a concise, yet thorough, listing of HTML tags and attributes specified by the W3C HTML 4.01 Specification, Netscape Navigator, and Internet Explorer.
The majority of this reference is an alphabetical listing of tags and their attributes with explanations and browser support information.
Section 1.2 lists tags that are related in functionality, and Section 1.3 provides examples of how standard web page elements are constructed.
At the end of the book are useful charts, including character entities and decimal to hexadecimal conversions.
More in-depth explanations of HTML and web design can be found in O'Reilly & Associates' Web Design in a Nutshell by Jennifer Niederst and HTML and XHTML: The Definitive Guide by Chuck Musciano and Bill Kennedy. Also useful is Webmaster in a Nutshell by Stephen Spainhour and Robert Eckstein.
The browser support information in this book was provided by the HTML Compendium created by Ron Woodall. I encourage you to check out the Compendium's site (http://www.htmlcompendium.org) for extremely in-depth explanations of HTML tags, attributes, and values and the browsers that support them.
The correct syntax appears to the right of each tag and indicates whether the tag is a container (with an end tag) or stands alone. Browser support information is indicated below each tag. Browsers that do not support the tag have a line drawn through them. Attribute support is indicated in italics in the attribute description.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Tag Groups
The following lists group HTML tags by similar function. See the Section 1.4 section for complete descriptions of each tag.
The following tags are used primarily to give the document structure.
<!DOCTYPE>
<base>
<body>
<head>
<html>
<link>
<meta>
<title>
Block-level elements are always formatted with a line-break before and after, with most adding some amount of additional space above and below as well.
<address>
<blockquote>
<dd>
<div>
<dl>
<dt>
<h1> through <h6>
<li>
<ol>
<p>
<ul>
The following tags affect the appearance of text. "Inline" means they can be applied to a string of characters within a block element without introducing line breaks.
<b>
<big>
<cite>
<code>
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
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.
The standard skeletal structure of an HTML document is as follows:
<HTML>
  <HEAD>
    <TITLE>document title</TITLE>
  </HEAD>
  <BODY>
    contents of document
  </BODY>
</HTML>
The following are examples of simple lists.

Section 1.3.2.1: Definition list

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

Section 1.3.2.2: Ordered (numbered) list

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

Section 1.3.2.3: Unordered (bulleted) list

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

Section 1.3.2.4: Nested list

<OL>
   <LI>
   <LI>
      <UL>
         <LI>
         <LI>
      </UL>
</OL>
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>
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">
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>
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Alphabetical Tag List
A number of attributes in the HTML 4.01 specification are shared by nearly all elements. To save space, they have been abbreviated in this book as they are in the specification as follows.
%coreattrs indicates the collection of core HTML attributes according to the HTML 4.01 specification:
id
Assigns a unique identifying name to the element
class
Assigns a classification name to the element
style
Associated style information
title
Advisory title/amplification
%i18n stands for "internationalization" (i + 18 characters + n) and includes attributes related to making documents and elements accessible in all languages:
lang
Specifies the language for the element by its two-character language code
dir
Specifies the direction of the element; values are ltr (left to right) or rtl (right to left)
%events indicates the core events (as defined in the HTML 4.01 Document Type Definition) used by scripting languages which are applicable to the element:
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Character Entity Chart
Characters not found in the normal alphanumeric character set, such as © or &, must be specified in HTML using character entities. Character entities can be defined by name (&name;) or by numeric value (&#nnn;). The browser interprets the string to display the proper character. Named entities are preferable because numeric values may be interpreted differently on different platforms.
Unless otherwise noted, the character entities are part of the HTML 2.0 and later standards and will work with nearly all available browsers. A"4.01" in the character's description indicates that character entity is part of the HTML 4.0 Specification and is supported only by Internet Explorer and Navigator versions 4.0 and higher. An "N" in the description indicates that the character is a nonstandard entity.
Number
Name
Symbol
Description
Version
&#009;
Horizontal tab
&#010;
Line feed
&#013;
Carriage return
&#032;
Space
&#033;
!
Exclamation point
&#034;
&quot;
"
Quotation mark
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Extended HTML 4.01 Entities
The HTML 4.01 specification introduces a wide variety of new character entities for rendering foreign languages, mathematical material, and other symbols. Their support is limited to the latest browser versions (IE 5.5 and NN 6, although NN4.x supports the Latin Extended-A set).
Number
Name
Symbol
Description
Version
&#338;
&OElig;
Œ
Capital ligature OE
4.0
&#339;
&oelig;
œ
Small ligature oe
4.0
&#352;
&Scaron;
Š
Capital S, caron
4.0
&#353;
&scaron;
š
Small s, caron
4.0
&#376
&Yuml;
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Decimal to Hexadecimal Conversion Chart
dec = hex
dec = hex
dec = hex
dec = hex
dec = hex
dec = hex
0 = 00
1 = 01
2 = 02
3 = 03
4 = 04
5 = 05
6 = 06
7 = 07
8 = 08
9 = 09
10 = 0A
11 = 0B
12 = 0C
13 = 0D
14 = 0E
15 = 0F
16 = 10
17 = 11
18 = 12
19 = 13
20 = 14
21 = 15
22 = 16
23 = 17
24 = 18
25 = 19
26 = 1A
27 = 1B
28 = 1C
29 = 1D
30 = 1E
31 = 1F
32 = 20
33 = 21
34 = 22
35 = 23
36 = 24
37 = 25
38 = 26
39 = 27
40 = 28
41 = 29
42 = 2A
43 = 2B
44 = 2C
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!

Return to HTML Pocket Reference