2 W3C Document Type Definition for the HyperText Markup Language
3 version 3.2 as ratified by a vote of W3C member companies.
4 For more information on W3C look at URL http://www.w3.org/
6 Date: Tuesday January 14th 1997
8 Author: Dave Raggett <dsr@w3.org>
10 HTML 3.2 aims to capture recommended practice as of early '96
11 and as such to be used as a replacement for HTML 2.0 (RFC 1866).
12 Widely deployed rendering attributes are included where they
13 have been shown to be interoperable. SCRIPT and STYLE are
14 included to smooth the introduction of client-side scripts
15 and style sheets. Browsers must avoid showing the contents
16 of these element Otherwise support for them is not required.
17 ID, CLASS and STYLE attributes are not included in this version
21 <!ENTITY % HTML.Version
22 "-//W3C//DTD HTML 3.2 Final//EN"
26 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
33 <!--================== Deprecated Features Switch =========================-->
35 <!ENTITY % HTML.Deprecated "INCLUDE">
37 <!--================== Imported Names =====================================-->
39 <!ENTITY % Content-Type "CDATA"
40 -- meaning a MIME content type, as per RFC1521
43 <!ENTITY % HTTP-Method "GET | POST"
44 -- as per HTTP specification
47 <!ENTITY % URL "CDATA"
48 -- The term URL means a CDATA attribute
49 whose value is a Uniform Resource Locator,
50 See RFC1808 (June 95) and RFC1738 (Dec 94).
53 <!-- Parameter Entities -->
55 <!ENTITY % head.misc "SCRIPT|STYLE|META|LINK" -- repeatable head elements -->
57 <!ENTITY % heading "H1|H2|H3|H4|H5|H6">
59 <!ENTITY % list "UL | OL | DIR | MENU">
61 <![ %HTML.Deprecated [
62 <!ENTITY % preformatted "PRE | XMP | LISTING">
65 <!ENTITY % preformatted "PRE">
67 <!--================ Character mnemonic entities ==========================-->
69 <!ENTITY % ISOlat1 PUBLIC
70 "ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML">
73 <!--================ Entities for special symbols =========================-->
74 <!-- &trade and &cbsp are not widely deployed and so not included here -->
76 <!ENTITY amp CDATA "&" -- ampersand -->
77 <!ENTITY gt CDATA ">" -- greater than -->
78 <!ENTITY lt CDATA "<" -- less than -->
80 <!--=================== Text Markup =======================================-->
82 <!ENTITY % font "TT | I | B | U | STRIKE | BIG | SMALL | SUB | SUP">
84 <!ENTITY % phrase "EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE">
86 <!ENTITY % special "A | IMG | APPLET | FONT | BASEFONT | BR | SCRIPT | MAP">
88 <!ENTITY % form "INPUT | SELECT | TEXTAREA">
90 <!ENTITY % text "#PCDATA | %font | %phrase | %special | %form">
92 <!ELEMENT (%font|%phrase) - - (%text)*>
94 <!-- there are also 16 widely known color names although
95 the resulting colors are implementation dependent:
97 aqua, black, blue, fuchsia, gray, green, lime, maroon,
98 navy, olive, purple, red, silver, teal, white, and yellow
100 These colors were originally picked as being the standard
101 16 colors supported with the Windows VGA palette.
104 <!ELEMENT FONT - - (%text)* -- local change to font -->
106 size CDATA #IMPLIED -- [+]nn e.g. size="+1", size=4 --
107 color CDATA #IMPLIED -- #RRGGBB in hex, e.g. red: color="#FF0000" --
110 <!ELEMENT BASEFONT - O EMPTY -- base font size (1 to 7)-->
112 size CDATA #IMPLIED -- e.g. size=3 --
115 <!ELEMENT BR - O EMPTY -- forced line break -->
117 clear (left|all|right|none) none -- control of text flow --
120 <!--================== HTML content models ================================-->
122 HTML has three basic content models:
124 %text character level elements and text strings
125 %flow block-like elements e.g. paragraphs and lists
126 %bodytext as %flow plus headers H1-H6 and ADDRESS
130 "P | %list | %preformatted | DL | DIV | CENTER |
131 BLOCKQUOTE | FORM | ISINDEX | HR | TABLE">
133 <!-- %flow is used for DD and LI -->
135 <!ENTITY % flow "(%text | %block)*">
137 <!--=================== Document Body =====================================-->
139 <!ENTITY % body.content "(%heading | %text | %block | ADDRESS)*">
141 <!ENTITY % color "CDATA" -- a color specification: #HHHHHH @@ details? -->
143 <!ENTITY % body-color-attrs "
144 bgcolor %color #IMPLIED
147 vlink %color #IMPLIED
148 alink %color #IMPLIED
151 <!ELEMENT BODY O O %body.content>
153 background %URL #IMPLIED -- texture tile for document background --
154 %body-color-attrs; -- bgcolor, text, link, vlink, alink --
157 <!ENTITY % address.content "((%text;) | P)*">
159 <!ELEMENT ADDRESS - - %address.content>
161 <!ELEMENT DIV - - %body.content>
163 align (left|center|right) #IMPLIED -- alignment of following text --
166 <!-- CENTER is a shorthand for DIV with ALIGN=CENTER -->
167 <!ELEMENT center - - %body.content>
169 <!--================== The Anchor Element =================================-->
171 <!ELEMENT A - - (%text)* -(A)>
173 name CDATA #IMPLIED -- named link end --
174 href %URL #IMPLIED -- URL for linked resource --
175 rel CDATA #IMPLIED -- forward link types --
176 rev CDATA #IMPLIED -- reverse link types --
177 title CDATA #IMPLIED -- advisory title string --
180 <!--================== Client-side image maps ============================-->
182 <!-- These can be placed in the same document or grouped in a
183 separate document although this isn't yet widely supported -->
185 <!ENTITY % SHAPE "(rect|circle|poly)">
186 <!ENTITY % COORDS "CDATA" -- comma separated list of numbers -->
188 <!ELEMENT MAP - - (AREA)*>
193 <!ELEMENT AREA - O EMPTY>
196 coords %COORDS #IMPLIED -- defines coordinates for shape --
197 href %URL #IMPLIED -- this region acts as hypertext link --
198 nohref (nohref) #IMPLIED -- this region has no action --
199 alt CDATA #REQUIRED -- needed for non-graphical user agents --
202 <!--================== The LINK Element ==================================-->
204 <!ENTITY % Types "CDATA"
205 -- See Internet Draft: draft-ietf-html-relrev-00.txt
206 LINK has been part of HTML since the early days
207 although few browsers as yet take advantage of it.
209 Relationship values can be used in principle:
211 a) for document specific toolbars/menus when used
212 with the LINK element in the document head:
213 b) to link to a separate style sheet
214 c) to make a link to a script
215 d) by stylesheets to control how collections of
216 html nodes are rendered into printed documents
217 e) to make a link to a printable version of this document
218 e.g. a postscript or pdf version
221 <!ELEMENT LINK - O EMPTY>
223 href %URL #IMPLIED -- URL for linked resource --
224 rel %Types #IMPLIED -- forward link types --
225 rev %Types #IMPLIED -- reverse link types --
226 title CDATA #IMPLIED -- advisory title string --
229 <!--=================== Images ============================================-->
231 <!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
232 <!ENTITY % Pixels "NUMBER" -- integer representing length in pixels -->
234 <!-- Suggested widths are used for negotiating image size
235 with the module responsible for painting the image.
236 align=left or right cause image to float to margin
237 and for subsequent text to wrap around image -->
239 <!ENTITY % IAlign "(top|middle|bottom|left|right)">
241 <!ELEMENT IMG - O EMPTY -- Embedded image -->
243 src %URL #REQUIRED -- URL of image to embed --
244 alt CDATA #IMPLIED -- for display in place of image --
245 align %IAlign #IMPLIED -- vertical or horizontal alignment --
246 height %Pixels #IMPLIED -- suggested height in pixels --
247 width %Pixels #IMPLIED -- suggested width in pixels --
248 border %Pixels #IMPLIED -- suggested link border width --
249 hspace %Pixels #IMPLIED -- suggested horizontal gutter --
250 vspace %Pixels #IMPLIED -- suggested vertical gutter --
251 usemap %URL #IMPLIED -- use client-side image map --
252 ismap (ismap) #IMPLIED -- use server image map --
255 <!-- USEMAP points to a MAP element which may be in this document
256 or an external document, although the latter is not widely supported -->
258 <!--=================== Java APPLET tag ===================================-->
260 This tag is supported by all Java enabled browsers. Applet resources
261 (including their classes) are normally loaded relative to the document
262 URL (or <BASE> element if it is defined). The CODEBASE attribute is used
263 to change this default behavior. If the CODEBASE attribute is defined then
264 it specifies a different location to find applet resources. The value
265 can be an absolute URL or a relative URL. The absolute URL is used as is
266 without modification and is not effected by the documents <BASE> element.
267 When the codebase attribute is relative, then it is relative to the
268 document URL (or <BASE> tag if defined).
270 <!ELEMENT APPLET - - (PARAM | %text)*>
272 codebase %URL #IMPLIED -- code base --
273 code CDATA #REQUIRED -- class file --
274 alt CDATA #IMPLIED -- for display in place of applet --
275 name CDATA #IMPLIED -- applet name --
276 width %Pixels #REQUIRED -- suggested width in pixels --
277 height %Pixels #REQUIRED -- suggested height in pixels --
278 align %IAlign #IMPLIED -- vertical or horizontal alignment --
279 hspace %Pixels #IMPLIED -- suggested horizontal gutter --
280 vspace %Pixels #IMPLIED -- suggested vertical gutter --
283 <!ELEMENT PARAM - O EMPTY>
285 name NMTOKEN #REQUIRED -- The name of the parameter --
286 value CDATA #IMPLIED -- The value of the parameter --
292 <applet codebase="applets/NervousText"
293 code=NervousText.class
296 <param name=text value="Java is Cool!">
297 <img src=sorry.gif alt="This looks better with Java support">
301 <!--=================== Horizontal Rule ===================================-->
303 <!ELEMENT HR - O EMPTY>
305 align (left|right|center) #IMPLIED
306 noshade (noshade) #IMPLIED
307 size %Pixels #IMPLIED
308 width %Length #IMPLIED
310 <!--=================== Paragraphs=========================================-->
312 <!ELEMENT P - O (%text)*>
314 align (left|center|right) #IMPLIED
317 <!--=================== Headings ==========================================-->
320 There are six levels of headers from H1 (the most important)
321 to H6 (the least important).
324 <!ELEMENT ( %heading ) - - (%text;)*>
325 <!ATTLIST ( %heading )
326 align (left|center|right) #IMPLIED
329 <!--=================== Preformatted Text =================================-->
331 <!-- excludes images and changes in font size -->
333 <!ENTITY % pre.exclusion "IMG|BIG|SMALL|SUB|SUP|FONT">
335 <!ELEMENT PRE - - (%text)* -(%pre.exclusion)>
337 width NUMBER #implied -- is this widely supported? --
340 <![ %HTML.Deprecated [
342 <!ENTITY % literal "CDATA"
343 -- historical, non-conforming parsing mode where
344 the only markup signal is the end tag
348 <!ELEMENT (XMP|LISTING) - - %literal>
349 <!ELEMENT PLAINTEXT - O %literal>
353 <!--=================== Block-like Quotes =================================-->
355 <!ELEMENT BLOCKQUOTE - - %body.content>
357 <!--=================== Lists =============================================-->
360 HTML 3.2 allows you to control the sequence number for ordered lists.
361 You can set the sequence number with the START and VALUE attributes.
362 The TYPE attribute may be used to specify the rendering of ordered
366 <!-- definition lists - DT for term, DD for its definition -->
368 <!ELEMENT DL - - (DT|DD)+>
370 compact (compact) #IMPLIED -- more compact style --
373 <!ELEMENT DT - O (%text)*>
374 <!ELEMENT DD - O %flow;>
376 <!-- Ordered lists OL, and unordered lists UL -->
377 <!ELEMENT (OL|UL) - - (LI)+>
381 1 arablic numbers 1, 2, 3, ...
382 a lower alpha a, b, c, ...
383 A upper alpha A, B, C, ...
384 i lower roman i, ii, iii, ...
385 I upper roman I, II, III, ...
387 The style is applied to the sequence number which by default
388 is reset to 1 for the first list item in an ordered list.
390 This can't be expressed directly in SGML due to case folding.
393 <!ENTITY % OLStyle "CDATA" -- constrained to: [1|a|A|i|I] -->
395 <!ATTLIST OL -- ordered lists --
396 type %OLStyle #IMPLIED -- numbering style --
397 start NUMBER #IMPLIED -- starting sequence number --
398 compact (compact) #IMPLIED -- reduced interitem spacing --
401 <!-- bullet styles -->
403 <!ENTITY % ULStyle "disc|square|circle">
405 <!ATTLIST UL -- unordered lists --
406 type (%ULStyle) #IMPLIED -- bullet style --
407 compact (compact) #IMPLIED -- reduced interitem spacing --
410 <!ELEMENT (DIR|MENU) - - (LI)+ -(%block)>
412 compact (compact) #IMPLIED
415 compact (compact) #IMPLIED
418 <!-- <DIR> Directory list -->
419 <!-- <DIR COMPACT> Compact list style -->
420 <!-- <MENU> Menu list -->
421 <!-- <MENU COMPACT> Compact list style -->
423 <!-- The type attribute can be used to change the bullet style
424 in unordered lists and the numbering style in ordered lists -->
426 <!ENTITY % LIStyle "CDATA" -- constrained to: "(%ULStyle|%OLStyle)" -->
428 <!ELEMENT LI - O %flow -- list item -->
430 type %LIStyle #IMPLIED -- list item style --
431 value NUMBER #IMPLIED -- reset sequence number --
434 <!--================ Forms ===============================================-->
436 <!ELEMENT FORM - - %body.content -(FORM)>
438 action %URL #IMPLIED -- server-side form handler --
439 method (%HTTP-Method) GET -- see HTTP specification --
440 enctype %Content-Type; "application/x-www-form-urlencoded"
444 "(TEXT | PASSWORD | CHECKBOX | RADIO | SUBMIT
445 | RESET | FILE | HIDDEN | IMAGE)">
447 <!ELEMENT INPUT - O EMPTY>
449 type %InputType TEXT -- what kind of widget is needed --
450 name CDATA #IMPLIED -- required for all but submit and reset --
451 value CDATA #IMPLIED -- required for radio and checkboxes --
452 checked (checked) #IMPLIED -- for radio buttons and check boxes --
453 size CDATA #IMPLIED -- specific to each type of field --
454 maxlength NUMBER #IMPLIED
455 src %URL #IMPLIED -- for fields with background images --
456 align (top|middle|bottom|left|right) top -- image alignment --
459 <!ELEMENT SELECT - - (OPTION+)>
463 multiple (multiple) #IMPLIED
466 <!ELEMENT OPTION - O (#PCDATA)*>
468 selected (selected) #IMPLIED
469 value CDATA #IMPLIED -- defaults to element content --
472 <!-- Multi-line text input field. -->
474 <!ELEMENT TEXTAREA - - (#PCDATA)*>
477 rows NUMBER #REQUIRED
478 cols NUMBER #REQUIRED
481 <!--======================= Tables ========================================-->
483 <!-- Widely deployed subset of the full table standard, see RFC 1942
484 e.g. at http://www.ics.uci.edu/pub/ietf/html/rfc1942.txt -->
486 <!-- horizontal placement of table relative to window -->
487 <!ENTITY % Where "(left|center|right)">
489 <!-- horizontal alignment attributes for cell contents -->
490 <!ENTITY % cell.halign
491 "align (left|center|right) #IMPLIED"
494 <!-- vertical alignment attributes for cell contents -->
495 <!ENTITY % cell.valign
496 "valign (top|middle|bottom) #IMPLIED"
499 <!ELEMENT table - - (caption?, tr+)>
500 <!ELEMENT tr - O (th|td)*>
501 <!ELEMENT (th|td) - O %body.content>
503 <!ATTLIST table -- table element --
504 align %Where; #IMPLIED -- table position relative to window --
505 width %Length #IMPLIED -- table width relative to window --
506 border %Pixels #IMPLIED -- controls frame width around table --
507 cellspacing %Pixels #IMPLIED -- spacing between cells --
508 cellpadding %Pixels #IMPLIED -- spacing within cells --
511 <!ELEMENT CAPTION - - (%text;)* -- table or figure caption -->
513 align (top|bottom) #IMPLIED
516 <!ATTLIST tr -- table row --
517 %cell.halign; -- horizontal alignment in cells --
518 %cell.valign; -- vertical alignment in cells --
521 <!ATTLIST (th|td) -- header or data cell --
522 nowrap (nowrap) #IMPLIED -- suppress word wrap --
523 rowspan NUMBER 1 -- number of rows spanned by cell --
524 colspan NUMBER 1 -- number of cols spanned by cell --
525 %cell.halign; -- horizontal alignment in cell --
526 %cell.valign; -- vertical alignment in cell --
527 width %Pixels #IMPLIED -- suggested width for cell --
528 height %Pixels #IMPLIED -- suggested height for cell --
531 <!--================ Document Head ========================================-->
533 <!-- %head.misc defined earlier on as "SCRIPT|STYLE|META|LINK" -->
535 <!ENTITY % head.content "TITLE & ISINDEX? & BASE?">
537 <!ELEMENT HEAD O O (%head.content) +(%head.misc)>
539 <!ELEMENT TITLE - - (#PCDATA)* -(%head.misc)
540 -- The TITLE element is not considered part of the flow of text.
541 It should be displayed, for example as the page header or
545 <!ELEMENT ISINDEX - O EMPTY>
547 prompt CDATA #IMPLIED -- prompt message -->
550 The BASE element gives an absolute URL for dereferencing relative
553 <BASE href="http://foo.com/index.html">
555 <IMG SRC="images/bar.gif">
557 The image is deferenced to
559 http://foo.com/images/bar.gif
561 In the absence of a BASE element the document URL should be used.
562 Note that this is not necessarily the same as the URL used to
563 request the document, as the base URL may be overridden by an HTTP
564 header accompanying the document.
567 <!ELEMENT BASE - O EMPTY>
572 <!ELEMENT META - O EMPTY -- Generic Metainformation -->
574 http-equiv NAME #IMPLIED -- HTTP response header name --
575 name NAME #IMPLIED -- metainformation name --
576 content CDATA #REQUIRED -- associated information --
579 <!-- SCRIPT/STYLE are place holders for transition to next version of HTML -->
581 <!ELEMENT STYLE - - (#PCDATA)* -(%head.misc) -- style info -->
582 <!ELEMENT SCRIPT - - (#PCDATA)* -(%head.misc) -- script statements -->
584 <!--================ Document Structure ===================================-->
586 <!ENTITY % version.attr "VERSION CDATA #FIXED '%HTML.Version;'">
588 <![ %HTML.Deprecated [
589 <!ENTITY % html.content "HEAD, BODY, PLAINTEXT?">
592 <!ENTITY % html.content "HEAD, BODY">
594 <!ELEMENT HTML O O (%html.content)>