2
W3C Document Type Definition for the HyperText Markup Language
3
This version is code named Wilbur with Style
7
Author of original HTML 3.2 DTD: Dave Raggett <dsr@w3.org>
10
Chris Lilley <chris@w3.org>
11
Dave Raggett <dsr@w3.org>
13
This Experimental HTML DTD adds support for Style Sheets,
14
as defined in WD-Style, to the HTML 3.2 DTD: ID, CLASS and
15
STYLE attributes on most elements, and the SPAN element.
18
<!ENTITY % HTML.Version
19
"-//W3C//DTD HTML Experimental 970421//EN"
23
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Experimental 970421//EN">
30
<!--================== Deprecated Features Switch ======================-->
32
<!ENTITY % HTML.Deprecated "INCLUDE">
34
<!--================== Imported Names ==================================-->
36
<!ENTITY % Content-Type "CDATA"
37
-- meaning a MIME content type, as per RFC1521
40
<!ENTITY % HTTP-Method "GET | POST"
41
-- as per HTTP specification
44
<!ENTITY % URL "CDATA"
45
-- The term URL means a CDATA attribute
46
whose value is a Uniform Resource Locator,
47
See RFC1808 (June 95) and RFC1738 (Dec 94).
50
<!-- Parameter Entities -->
52
<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK" -- repeatable head elements -->
54
<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
56
<!ENTITY % list "UL | OL | DIR | MENU">
58
<![ %HTML.Deprecated [
59
<!ENTITY % preformatted "PRE | XMP | LISTING">
62
<!ENTITY % preformatted "PRE">
64
<!--================ Character mnemonic entities =======================-->
66
<!ENTITY % ISOlat1 PUBLIC
67
"ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML">
70
<!--================ Entities for special symbols ======================-->
71
<!-- &trade and &cbsp are not widely deployed and so not included here -->
73
<!ENTITY copy CDATA "©" -- copyright sign -->
74
<!ENTITY reg CDATA "®" -- registered sign -->
75
<!ENTITY amp CDATA "&" -- ampersand -->
76
<!ENTITY gt CDATA ">" -- greater than -->
77
<!ENTITY lt CDATA "<" -- less than -->
78
<!ENTITY quot CDATA """ -- double quote -->
79
<!ENTITY nbsp CDATA " " -- non breaking space -->
81
<!--=================== Text Markup ====================================-->
83
<!ENTITY % font "TT | I | B | U | STRIKE | BIG | SMALL | SUB | SUP">
85
<!ENTITY % phrase "EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE">
87
<!ENTITY % special "A|IMG|APPLET|BASEFONT|FONT|BR|SCRIPT|MAP|SPAN">
89
<!ENTITY % form "INPUT | SELECT | TEXTAREA">
91
<!ENTITY % text "#PCDATA | %font | %phrase | %special | %form">
94
"id ID #IMPLIED -- document wide unique id --
95
class CDATA #IMPLIED -- comma list of class values --
96
style CDATA #IMPLIED -- associated style info --">
98
<!ELEMENT (%font|%phrase) - - (%text)*>
99
<!ATTLIST (%font|%phrase) %style;>
101
<!-- there are also 16 widely known color names although
102
the resulting colors are implementation dependent:
104
aqua, black, blue, fuchsia, gray, green, lime, maroon,
105
navy, olive, purple, red, silver, teal, white, and yellow
107
These colors were originally picked as being the standard
108
16 colors supported with the Windows VGA palette.
111
<!-- use span when other text-level elements are inappropriate -->
112
<!ELEMENT SPAN - - (%text)* -- generic language/style container -->
113
<!ATTLIST SPAN %style; >
115
<!ELEMENT FONT - - (%text)* -- local change to font -->
117
size CDATA #IMPLIED -- [+]nn e.g. size="+1", size=4 --
118
color CDATA #IMPLIED -- #RRGGBB in hex, e.g. red: color="#FF0000"
123
<!ELEMENT BASEFONT - O EMPTY -- base font size (1 to 7)-->
125
size CDATA #IMPLIED -- e.g. size=3 --
128
<!ELEMENT BR - O EMPTY -- forced line break -->
130
clear (left|all|right|none) none -- control of text flow --
134
<!--================== HTML content models =============================-->
136
HTML has three basic content models:
138
%text character level elements and text strings
139
%flow block-like elements e.g. paragraphs and lists
140
%bodytext as %flow plus headers and ADDRESS
144
"P | %list | %preformatted | DL | DIV | CENTER |
145
BLOCKQUOTE | FORM | ISINDEX | HR | TABLE">
147
<!-- %flow is used for DD and LI -->
149
<!ENTITY % flow "(%text | %block)*">
151
<!--=================== Document Body ==================================-->
153
<!ENTITY % body.content "(%heading | %text | %block | ADDRESS)*">
155
<!ENTITY % color "CDATA" -- a color specification: #RRGGBB in hex -->
157
<!ENTITY % body-color-attrs "
158
bgcolor %color #IMPLIED
161
vlink %color #IMPLIED
162
alink %color #IMPLIED
165
<!ELEMENT BODY O O %body.content>
167
background %URL #IMPLIED -- texture tile for document background --
168
%body-color-attrs; -- bgcolor, text, link, vlink, alink --
172
<!ENTITY % address.content "((%text;) | P)*">
174
<!ELEMENT ADDRESS - - %address.content>
175
<!ATTLIST ADDRESS %style; >
177
<!ELEMENT DIV - - %body.content>
179
align (left|center|right) #IMPLIED -- alignment of following text --
183
<!-- CENTER is a shorthand for DIV with ALIGN=CENTER -->
184
<!ELEMENT center - - %body.content>
186
<!--================== The Anchor Element ==============================-->
188
<!ELEMENT A - - (%text)* -(A)>
190
name CDATA #IMPLIED -- named link end --
191
href %URL #IMPLIED -- URL for linked resource --
192
rel CDATA #IMPLIED -- forward link types --
193
rev CDATA #IMPLIED -- reverse link types --
194
title CDATA #IMPLIED -- advisory title string --
198
<!--================== Client-side image maps =========================-->
200
<!-- These can be placed in the same document or grouped in a
201
separate document although this isn't yet widely supported -->
203
<!ENTITY % SHAPE "(rect|circle|poly)">
204
<!ENTITY % COORDS "CDATA" -- comma separated list of numbers -->
206
<!ELEMENT MAP - - (AREA)*>
211
<!ELEMENT AREA - O EMPTY>
214
coords %COORDS #IMPLIED -- defines coordinates for shape --
215
href %URL #IMPLIED -- this region acts as hypertext link --
216
nohref (nohref) #IMPLIED -- this region has no action --
217
alt CDATA #REQUIRED -- needed for non-graphical user agents --
220
<!--================== The LINK Element ===============================-->
222
<!ENTITY % Types "CDATA"
223
-- LINK has been part of HTML since the early days
224
although few browsers as yet take advantage of it.
226
Relationship values can be used in principle:
228
a) for document specific toolbars/menus when used
229
with the LINK element in document head:
230
b) to link to a separate style sheet (rel=stylesheet)
231
c) to make a link to a script (rel=script)
232
d) by stylesheets to control how collections of
233
html nodes are rendered into printed documents
234
e) to make a link to a printable version of this document
235
e.g. a postscript/pdf version (rel=alternate media=print)
238
"(print|screen|projection|braille|aural|all)"
240
Media values define the intended rendering medium for a style
241
sheet or other resource. It shouldn't be confused with the data
242
format used to encode that resource.
245
<!ELEMENT LINK - O EMPTY>
247
href %URL #IMPLIED -- URL for linked resource --
248
rel %Types #IMPLIED -- forward link types --
249
rev %Types #IMPLIED -- reverse link types --
250
media %MEDIA all -- intended rendering medium --
251
title CDATA #IMPLIED -- advisory title string --
254
<!--=================== Images =========================================-->
256
<!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
257
<!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->
259
<!-- Suggested widths are used for negotiating image size
260
with the module responsible for painting the image.
261
align=left or right cause image to float to margin
262
and for subsequent text to wrap around image -->
264
<!ENTITY % IAlign "(top|middle|bottom|left|right)">
266
<!ELEMENT IMG - O EMPTY -- Embedded image -->
268
src %URL #REQUIRED -- URL of image to embed --
269
alt CDATA #IMPLIED -- for display in place of image --
270
align %IAlign #IMPLIED -- vertical or horizontal alignment --
271
height %Pixels #IMPLIED -- suggested height in pixels --
272
width %Pixels #IMPLIED -- suggested width in pixels --
273
border %Pixels #IMPLIED -- suggested link border width --
274
hspace %Pixels #IMPLIED -- suggested horizontal gutter --
275
vspace %Pixels #IMPLIED -- suggested vertical gutter --
276
usemap %URL #IMPLIED -- use client-side image map --
277
ismap (ismap) #IMPLIED -- use server image map --
281
<!-- USEMAP points to a MAP element which may be in this document
282
or an external document, although the latter is not widely supported -->
284
<!--=================== Java APPLET tag ================================-->
286
This tag is supported by all Java enabled browsers. CODEBASE specifies
287
the base URL of the applet - the directory that contains the applet's
288
code. If this attribute is missing the documents base URL is used
289
instead. One of CODE or OBJECT must be present. Archive files speed
290
loading of applets through a compressed wrapper for applet resources.
291
The ALT attribute gives text to display if the browser understands
292
the APPLET tag but can't run Java applets. WIDTH, HEIGHT, ALIGN,
293
HSPACE and VSPACE are defined in the same way as for IMG elements.
295
<!ELEMENT APPLET - - (PARAM | %text)*>
297
codebase %URL #IMPLIED -- optional base URL for applet --
298
archive CDATA #IMPLIED -- comma separated archive list --
299
code CDATA #IMPLIED -- applet class file --
300
object CDATA #IMPLIED -- serialized applet file --
301
alt CDATA #IMPLIED -- for display in place of applet --
302
name CDATA #IMPLIED -- allows applets to find each other --
303
width %Pixels #REQUIRED -- suggested width in pixels --
304
height %Pixels #REQUIRED -- suggested height in pixels --
305
align %IAlign #IMPLIED -- vertical or horizontal alignment --
306
hspace %Pixels #IMPLIED -- suggested horizontal gutter --
307
vspace %Pixels #IMPLIED -- suggested vertical gutter --
310
<!ELEMENT PARAM - O EMPTY>
312
name NMTOKEN #REQUIRED -- The name of the parameter --
313
value CDATA #IMPLIED -- The value of the parameter --
319
<applet codebase="applets/NervousText"
320
code=NervousText.class
323
<param name=text value="Java is Cool!">
324
<img src=sorry.gif alt="This looks better with Java support">
328
<!--=================== Horizontal Rule ================================-->
330
<!ELEMENT HR - O EMPTY>
332
align (left|right|center) #IMPLIED
333
noshade (noshade) #IMPLIED
334
size %Pixels #IMPLIED
335
width %Length #IMPLIED
338
<!--=================== Paragraphs======================================-->
340
<!ELEMENT P - O (%text)*>
342
align (left|center|right) #IMPLIED
346
<!--=================== Headings =======================================-->
349
There are six levels of headers from H1 (the most important)
350
to H6 (the least important).
353
<!ELEMENT ( %heading ) - - (%text;)*>
354
<!ATTLIST ( %heading )
355
align (left|center|right) #IMPLIED
359
<!--=================== Preformatted Text ==============================-->
361
<!-- excludes images and changes in font size to preserve column alignment --
364
<!ENTITY % pre.exclusion "IMG|BIG|SMALL|SUB|SUP|FONT">
366
<!ELEMENT PRE - - (%text)* -(%pre.exclusion)>
368
width NUMBER #implied -- is this widely supported? --
372
<![ %HTML.Deprecated [
374
<!ENTITY % literal "CDATA"
375
-- historical, non-conforming parsing mode where
376
the only markup signal is the end tag
380
<!ELEMENT (XMP|LISTING) - - %literal>
381
<!ELEMENT PLAINTEXT - O %literal>
385
<!--=================== Block-like Quotes ==============================-->
387
<!ELEMENT BLOCKQUOTE - - %body.content>
388
<!ATTLIST BLOCKQUOTE %style;>
389
<!--=================== Lists ==========================================-->
392
HTML 3.2 allows you to control the sequence number for ordered lists.
393
You can set the sequence number with the START and VALUE attributes.
394
The TYPE attribute may be used to specify the rendering of ordered
398
<!-- definition lists - DT for term, DD for its definition -->
400
<!ELEMENT DL - - (DT|DD)+>
402
compact (compact) #IMPLIED -- more compact style --
406
<!ELEMENT DT - O (%text)*>
407
<!ATTLIST DT %style;>
408
<!ELEMENT DD - O %flow;>
409
<!ATTLIST DD %style;>
411
<!-- Ordered lists OL, and unordered lists UL -->
412
<!ELEMENT (OL|UL) - - (LI)+>
416
1 arablic numbers 1, 2, 3, ...
417
a lower alpha a, b, c, ...
418
A upper alpha A, B, C, ...
419
i lower roman i, ii, iii, ...
420
I upper roman I, II, III, ...
422
The style is applied to the sequence number which by default
423
is reset to 1 for the first list item in an ordered list.
425
This can't be expressed directly in SGML due to case folding.
428
<!ENTITY % OLStyle "CDATA" -- constrained to: [1|a|A|i|I] -->
430
<!ATTLIST OL -- ordered lists --
431
type %OLStyle #IMPLIED -- numbering style --
432
start NUMBER #IMPLIED -- starting sequence number --
433
compact (compact) #IMPLIED -- reduced interitem spacing --
437
<!-- bullet styles -->
439
<!ENTITY % ULStyle "disc|square|circle">
441
<!ATTLIST UL -- unordered lists --
442
type (%ULStyle) #IMPLIED -- bullet style --
443
compact (compact) #IMPLIED -- reduced interitem spacing --
447
<!ELEMENT (DIR|MENU) - - (LI)+ -(%block)>
449
compact (compact) #IMPLIED
453
compact (compact) #IMPLIED
457
<!-- <DIR> Directory list -->
458
<!-- <DIR COMPACT> Compact list style -->
459
<!-- <MENU> Menu list -->
460
<!-- <MENU COMPACT> Compact list style -->
462
<!-- The type attribute can be used to change the bullet style
463
in unordered lists and the numbering style in ordered lists -->
465
<!ENTITY % LIStyle "CDATA" -- constrained to: "(%ULStyle|%OLStyle)" -->
467
<!ELEMENT LI - O %flow -- list item -->
469
type %LIStyle #IMPLIED -- list item style --
470
value NUMBER #IMPLIED -- reset sequence number --
474
<!--================ Forms ============================================-->
476
<!ELEMENT FORM - - %body.content -(FORM)>
478
action %URL #IMPLIED -- server-side form handler --
479
method (%HTTP-Method) GET -- see HTTP specification --
480
enctype %Content-Type; "application/x-www-form-urlencoded"
485
"(TEXT | PASSWORD | CHECKBOX | RADIO | SUBMIT
486
| RESET | FILE | HIDDEN | IMAGE)">
488
<!ELEMENT INPUT - O EMPTY>
490
type %InputType TEXT -- what kind of widget is needed --
491
name CDATA #IMPLIED -- required for all but submit and reset --
492
value CDATA #IMPLIED -- required for radio and checkboxes --
493
checked (checked) #IMPLIED -- for radio buttons and check boxes --
494
size CDATA #IMPLIED -- specific to each type of field --
495
maxlength NUMBER #IMPLIED -- max chars allowed in text fields --
496
src %URL #IMPLIED -- for fields with background images --
497
align %IAlign #IMPLIED -- image alignment --
498
usemap %URL #IMPLIED -- use client-side image map --
499
hspace %Pixels #IMPLIED -- suggested horizontal gutter --
500
vspace %Pixels #IMPLIED -- suggested vertical gutter --
504
<!ELEMENT SELECT - - (OPTION+)>
508
multiple (multiple) #IMPLIED
512
<!ELEMENT OPTION - O (#PCDATA)*>
514
selected (selected) #IMPLIED
515
value CDATA #IMPLIED -- defaults to element content --
519
<!-- Multi-line text input field. -->
521
<!ELEMENT TEXTAREA - - (#PCDATA)*>
524
rows NUMBER #REQUIRED
525
cols NUMBER #REQUIRED
529
<!--======================= Tables =====================================-->
531
<!-- Widely deployed subset of the full table standard, see RFC 1942
532
e.g. at http://www.ics.uci.edu/pub/ietf/html/rfc1942.txt -->
534
<!-- horizontal placement of table relative to window -->
535
<!ENTITY % Where "(left|center|right)">
537
<!-- horizontal alignment attributes for cell contents -->
538
<!ENTITY % cell.halign
539
"align (left|center|right) #IMPLIED"
542
<!-- vertical alignment attributes for cell contents -->
543
<!ENTITY % cell.valign
544
"valign (top|middle|bottom) #IMPLIED"
547
<!ELEMENT TABLE - - (CAPTION?, TR+)>
548
<!ELEMENT TR - O (TH|TD)*>
549
<!ELEMENT (TH|TD) - O %body.content>
551
<!ATTLIST TABLE -- table element --
552
align %Where #IMPLIED -- table position relative to window --
553
width %Length #IMPLIED -- table width relative to window --
554
border %Pixels #IMPLIED -- controls frame width around table --
555
cellspacing %Pixels #IMPLIED -- spacing between cells --
556
cellpadding %Pixels #IMPLIED -- spacing within cells --
560
<!ELEMENT CAPTION - - (%text;)* -- table or figure caption -->
562
align (top|bottom) #IMPLIED
566
<!ATTLIST TR -- table row --
567
%cell.halign; -- horizontal alignment in cells --
568
%cell.valign; -- vertical alignment in cells --
572
<!ATTLIST (TH|TD) -- header or data cell --
573
nowrap (nowrap) #IMPLIED -- suppress word wrap --
574
rowspan NUMBER 1 -- number of rows spanned by cell --
575
colspan NUMBER 1 -- number of cols spanned by cell --
576
%cell.halign; -- horizontal alignment in cells --
577
%cell.valign; -- vertical alignment in cells --
578
width %Pixels #IMPLIED -- suggested width for cell --
579
height %Pixels #IMPLIED -- suggested height for cell --
583
<!--================ Document Head =====================================-->
585
<!-- %head.misc defined earlier on as "SCRIPT|STYLE|META|LINK" -->
587
<!ENTITY % head.content "TITLE & ISINDEX? & BASE?">
589
<!ELEMENT HEAD O O (%head.content) +(%head.misc)>
591
<!ELEMENT TITLE - - (#PCDATA)* -(%head.misc)
592
-- The TITLE element is not considered part of the flow of text.
593
It should be displayed, for example as the page header or
597
<!ELEMENT ISINDEX - O EMPTY>
599
prompt CDATA #IMPLIED -- prompt message --
604
The BASE element gives an absolute URL for dereferencing relative
607
<BASE href="http://foo.com/index.html">
609
<IMG SRC="images/bar.gif">
611
The image is deferenced to
613
http://foo.com/images/bar.gif
615
In the absence of a BASE element the document URL should be used.
616
Note that this is not necessarily the same as the URL used to
617
request the document, as the base URL may be overridden by an HTTP
618
header accompanying the document.
621
<!ELEMENT BASE - O EMPTY>
626
<!ELEMENT META - O EMPTY -- Generic Metainformation -->
628
http-equiv NAME #IMPLIED -- HTTP response header name --
629
name NAME #IMPLIED -- metainformation name --
630
content CDATA #REQUIRED -- associated information --
633
<!ELEMENT STYLE - - CDATA -- style info -->
635
type CDATA #IMPLIED -- Internet media type for style --
636
title CDATA #IMPLIED -- advisory title for this style --
637
media %MEDIA ALL -- intended rendering medium --
640
<!-- SCRIPT is a place holder for transition to next version of HTML -->
641
<!ELEMENT SCRIPT - - CDATA -- script statements -->
643
<!--================ Document Structure ================================-->
645
<!ENTITY % version.attr "VERSION CDATA #FIXED '%HTML.Version;'">
647
<![ %HTML.Deprecated [
648
<!ENTITY % html.content "HEAD, BODY, PLAINTEXT?">
650
<!ENTITY % html.content "HEAD, BODY">
652
<!ELEMENT HTML O O (%html.content)>