BUY THIS BOOK

Safari Books Online

What is this?

Looking to Reprint this content?


HTML Pocket Reference
HTML Pocket Reference By Jennifer Niederst Robbins
December 1999
Pages: 95

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.0 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.
Following the alphabetical tag list are two sections that provide more context for using HTML. Section 1.3 lists tags that are related in functionality, and Section 1.4 provides examples of how standard web page elements are constructed.
So, for example, if you are making a table, Section 1.3.9 lists all the tags that pertain to tables, and the examples in Section 1.4.5 show the basic structure of how the table tags work together.
The book also provides several useful charts, including Character Entities, Decimal to Hexadecimal Conversions, and Color Names.
More in-depth explanations of HTML and web design can be found in O'Reilly and Associates' Web Design in a Nutshell by Jennifer Niederst and HTML: 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 below each tag and indicates whether the tag is a container (with an end tag) or stands alone. Browser support information is indicated to the right of each tag. Browsers that do not support the tag are shown in gray. A superscript D indicates that the tag has been deprecated by the specification or browser. Attribute support is indicated in italics in the attribute description.
<a>
NN: 2, 3, 4 &bull; MSIE: 2, 3, 4, 5 &bull; HTML 4 &bull; WebTV &bull; Opera3
<a>...</a>
Defines an anchor within the document. An anchor is used to link to another document. It can also serve to label a fragment of a document (also called a
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.0 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.
Following the alphabetical tag list are two sections that provide more context for using HTML. Section 1.3 lists tags that are related in functionality, and Section 1.4 provides examples of how standard web page elements are constructed.
So, for example, if you are making a table, Section 1.3.9 lists all the tags that pertain to tables, and the examples in Section 1.4.5 show the basic structure of how the table tags work together.
The book also provides several useful charts, including Character Entities, Decimal to Hexadecimal Conversions, and Color Names.
More in-depth explanations of HTML and web design can be found in O'Reilly and Associates' Web Design in a Nutshell by Jennifer Niederst and HTML: 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 below each tag and indicates whether the tag is a container (with an end tag) or stands alone. Browser support information is indicated to the right of each tag. Browsers that do not support the tag are shown in gray. A superscript D indicates that the tag has been deprecated by the specification or browser. 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!
Alphabetical Tag List
<a>
NN: 2, 3, 4 &bull; MSIE: 2, 3, 4, 5 &bull; HTML 4 &bull; WebTV &bull; Opera3
<a>...</a>
Defines an anchor within the document. An anchor is used to link to another document. It can also serve to label a fragment of a document (also called a named anchor), which is used as a reference for linking to a specific point in an HTML document.
Attributes
href=url
Specifies the URL of the target destination.
method=value
Specifies a list of names, each representing a particular document-processing method, usually an application name. It is browser-dependent and is rarely used in practice.
name=text
Identifies and names a portion of the document (called a "fragment"). The fragment can be referenced within a URL, preceded by the hash (#) symbol. See the following Section .
rel=next|prev|head|toc|parent|child|index|glossary
Not supported by Navigator or Opera. Establishes a relationship between the current document and the target document.
rev=relationship
Not supported by Navigator or Opera. Specifies the relationship from the target back to the source (the opposite of the rel attribute). The relationship options are the same as for the rel attribute.
title=text
Specifies a title for the target document.
target=name|_blank|_self|_parent|_top
Not supported by WebTV or Internet Explorer 2.0 and earlier. Specifies the name of the window or frame in which the target document should be displayed. The standard target names work as follows:
_blank
Opens a new, unnamed browser window.
_self
Loads the linked document into the same frame or window as the source document. This is the default target for all links.
_parent
Linked document loads into the parent frame (one step up in the frame hierarchy).
_top
Causes document to load at the top-level window containing the link, replacing any frames currently displayed.
urn=urn
Specifies a Universal Resource Name (URN) for the referenced document. URN syntax is currently not defined so this attribute has no practical use.
New in HTML 4.0 Specification
accesskey=character
Assigns an access key (shortcut key command) to the link. Access keys are also used for form fields. The value is a single character.
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 Section 1.2 for complete descriptions of each tag.
The following tags are used primarily to give the document structure.
<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>
<em>
<font> (deprecated)
<i>
<kbd>
<pre>
<s> (deprecated)
<samp>
<small>
<span>
<strike> (deprecated)
<strong>
<sub>
<sup>
<tt>
<u> (deprecated)
<var>
Logical or content-based styles describe the enclosed text's meaning, context, or usage and leave rendering of the tag to the browser.
<abbr>
<acronym>
<cite>
<code>
<del>
<div>
<em>
<ins>
<kbd>
<q>
<samp>
<span>
<strong>
<var>
Physical styles provide specific display instructions.
<b>
<big>
<blink>
<font>
<i>
<s>
<small>
<strike>
<sub>
<sup>
<tt>
<u>
<dir> (deprecated)
<dl>
<dd>
<dt>
<li>
<menu> (deprecated)
<ol>
<ul>
The following tags give authors control over the line breaks, alignment, and spacing within an HTML document.
<br>
<center> (deprecated)
<nobr>
<pre>
<spacer>
<table> (<th>, <tr>, <td>)
<wbr>
The following tags are used to create links from one document to another.
<a>
<map> (used in client-side imagemaps)
<area> (used in client-side imagemaps)
The following tags are used in the creation and formatting of tables.
<caption>
<table>
<td>
<th>
The following table tags are supported by HTML 4.0 and Internet Explorer 4.0 and higher.
<col>
<colgroup>
<tbody>
<thead>
<tfoot>
Frames are created using the following tags.
<frame>
<frameset>
<noframes>
The following forms are used to define forms and their elements.
<button>
<form>
<input>
   (type=button|checkbox|file|hidden|image|
         password|radio|reset|submit|text)

<option>
<select>
<textarea>

The following form tags are supported by HTML 4.0 and Internet Explorer 4.0 and higher.
<fieldset>
<label>
<legend>
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.4.2.1: Definition list

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

Section 1.4.2.2: Ordered (numbered) list

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

Section 1.4.2.3: Unordered (bulleted) list

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

Section 1.4.2.4: Nested lists

<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>
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>

Section 1.4.6.1: Nested frames

You can place one frameset within another as shown in the following example.
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.0" 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
&#009;
Horizontal tab
&#010;
Line feed
&#013;
Carriage return
&#032;
Space
&#033;
!
Exclamation point
&#034;
&quot;
"
Quotation mark
&#035;
#
Hash mark
&#036;
$
Dollar sign
&#037;
%
Percent sign
&#038;
&amp;
&
Ampersand
&#039;
'
Apostrophe
&#040;
(
Left parenthesis
&#041;
)
Right parenthesis
&#042;
*
Asterisk
&#043;
+
Plus sign
&#044;
,
Comma
&#045;
-
Hyphen
&#046;
.
Period
&#047;
/
Slash
&#048;- &#057;
0-9
Digits 0–9
&#058;
:
Colon
&#059;
;
Semicolon
&#060;
&lt;
<
Less than
&#061;
=
Equal sign
&#062;
&gt;
>
Greater than
&#063;
?
Question mark
&#064;
@
Commercial at sign
&#065;-&#090;
A–-Z
Letters A–Z
&#091;
[
Left square bracket
&#092;
\
Backslash
&#093;
]
Right square bracket
&#094;
^
Caret
&#095;
_
Underscore
&#096;
`
Grave accent
&#097;- &#122;
a–z
Letters a–z
&#123;
{
Left curly brace
&#124;
|
Vertical bar
&#125;
}
Right curly brace
&#126;
~
Tilde
&#130;
,
Comma (N)
&#131;
ƒ
Florin (N)
&#132;
Right double quote (N)
&#133;
...
Ellipsis (N)
&#134;
Dagger (N)
&#135;
Double dagger (N)
&#136;
^
Circumflex (N)
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
45 = 2D
46 = 2E
47 = 2F
48 = 30
49 = 31
50 = 32
51 = 33
52 = 34
53 = 35
54 = 36
55 = 37
56 = 38
57 = 39
58 = 3A
59 = 3B
60 = 3C
61 = 3D
62 = 3E
63 = 3F
64 = 40
65 = 41
66 = 42
67 = 43
68 = 44
69 = 45
70 = 46
71 = 47
72 = 48
73 = 49
74 = 4A
75 = 4B
76 = 4C
77 = 4D
78 = 4E
79 = 4F
80 = 50
81 = 51
82 = 52
83 = 53
84 = 54
85 = 55
86 = 56
87 = 57
88 = 58
89 = 59
90 = 5A
91 = 5B
92 = 5C
93 = 5D
94 = 5E
95 = 5F
96 = 60
97 = 61
98 = 62
99 = 63
100 = 64
101 = 65
102 = 66
103 = 67
104 = 68
105 = 69
106 = 6A
107 = 6B
108 = 6C
109 = 6D
110 = 6E
111 = 6F
112 = 70
113 = 71
114 = 72
115 = 73
116 = 74
117 = 75
118 = 76
119 = 77
120 = 78
121 = 79
122 = 7A
123 = 7B
124 = 7C
125 = 7D
126 = 7E
127 = 7F
128 = 80
129 = 81
130 = 82
131 = 83
132 = 84
133 = 85
134 = 86
135 = 87
136 = 88
137 = 89
138 = 8A
139 = 8B
140 = 8C
141 = 8D
142 = 8E
143 = 8F
144 = 90
145 = 91
146 = 92
147 = 93
148 = 94
149 = 95
150 = 96
151 = 97
152 = 98
153 = 99
154 = 9A
155 = 9B
156 = 9C
157 = 9D
158 = 9E
159 = 9F
160 = A0
161 = A1
162 = A2
163 = A3
164 = A4
165 = A5
166 = A6
167 = A7
168 = A8
169 = A9
170 = AA
171 = AB
172 = AC
173 = AD
174 = AE
175 = AF
176 = B0
177 = B1
178 = B2
179 = B3
180 = B4
181 = B5
182 = B6
183 = B7
184 = B8
185 = B9
186 = BA
187 = BB
188 = BC
189 = BD
190 = BE
191 = BF
192 = C0
193 = C1
194 = C2
195 = C3
196 = C4
197 = C5
198 = C6
199 = C7
200 = C8
201 = C9
202 = CA
203 = CB
204 = CC
205 = CD
206 = CE
207 = CF
208 = D0
209 = D1
210 = D2
211 = D3
212 = D4
213 = D5
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Color Names
Colors can be identified by one of 140 color names originally developed for the X Window System. The complete list appears below.
Color names are only supported by Navigator versions 2.0 and higher and Internet Explorer versions 3.0 and higher. Internet Explorer 2.0 supports the following 16 color names:
aqua
gray
navy
silver
black
green
olive
teal
blue
lime
purple
white
fuschia
maroon
red
yellow
Of the 140 color names, only 10 represent nondithering colors from the Web Palette. They are: aqua, black, blue, cyan, fuschia, lime, magenta, red, white, and yellow.
When viewed on an 8-bit display, the remaining 130 colors will shift to their nearest Web Palette equivalent (or System Palette color). In many cases, the difference is drastic. Many of the pastels shift to solid white.
The "Nearest Web-safe Color" column lists the color that will actually be displayed for each color name on an 8-bit display.
Color Name
RGB Values
Hexa-decimal
Nearest Web-safe Color
aliceblue
240 - 248 - 255
F0F8FF
FFFFFF
antiquewhite
250 - 235 - 215
FAEBD7
FFFFCC
aqua
0 - 255 - 255
00FFFF
00FFFF
aquamarine
127 - 255 - 212
7FFFD4
66FFCC
azure
240 - 255 - 255
F0FFFF
FFFFFF
beige
245 - 245 - 220
F5F5DC
FFFFCC
bisque
255 - 228 - 196
FFE4C4
FFFFCC
black
0 - 0 - 0
000000
000000
blanchedalmond
255 - 255 - 205
FFEBCD
FFFFCC
blue
0 - 0 - 255
0000FF
0000FF
blueviolet
138 - 43 - 226
8A2BE2
9933FF
brown
165 - 42 - 42
A52A2A
993333
burlywood
222 - 184 - 135
DEB887
CCCC99
cadetblue
95 - 158 - 160
5F9EA0
669999
chartreuse
127 - 255 - 0
7FFF00
66FF00
chocolate
210 - 105 - 30
D2691E
996600
coral
255 - 127 - 80
FF7F50
FF6666
cornflowerblue
100 - 149 - 237
6495ED
6699FF
cornsilk
255 - 248 - 220
FFF8DC
FFFFCC
crimson
220 - 20 - 60
DC143C
CC0033
cyan
0 - 255 - 255
00FFFF
00FFFF
darkblue
0 - 0 - 139
00008B
000099
darkcyan
0 - 139 - 139
008B8B
009999
darkgoldenrod
184 - 134 - 11
B8860B
CC9900
darkgray
169 - 169 - 169
A9A9A9
999999
darkgreen
0 - 100 - 0
006400
006600
darkkhaki
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