-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtml-spec.html
More file actions
executable file
·4447 lines (3486 loc) · 174 KB
/
html-spec.html
File metadata and controls
executable file
·4447 lines (3486 loc) · 174 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//EN"><HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.36
from ../html-spec.texi on 23 January 1996 -->
<TITLE>Hypertext Markup Language - 2.0 </TITLE>
</HEAD>
<BODY>
<H1>Hypertext Markup Language - 2.0 </H1>
<H1><A NAME="SEC1" HREF="html-spec_toc.html#SEC1" REL=TOC>Introduction</A></H1>
<P>
The HyperText <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>Markup</A> Language (HTML) is a simple data format
used to create hypertext documents that are portable from one platform
to another. HTML documents are SGML documents with generic semantics
that are appropriate for representing information from a wide range of
domains.
</P>
<P>
As HTML is an application of SGML, this specification assumes a
working knowledge of <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>.
</P>
<H2><A NAME="SEC1.1" HREF="html-spec_toc.html#SEC1.1" REL=TOC>Scope</A></H2>
<P>
HTML has been in use by the World-Wide Web (<A HREF="html-spec.html#GLOSS37" REL=GLOSSARY>WWW</A>) global information
initiative since 1990. Previously, informal documentation on HTML has
been available from a number of sources on the Internet. This
specification brings together, clarifies, and formalizes a set of
features that roughly corresponds to the capabilities of HTML in
common use prior to June 1994. A number of new features to HTML are
being proposed and experimented in the Internet community.
</P>
<P>
This document thus defines a HTML 2.0 (to distinguish it from the
previous informal specifications). Future (generally upwardly
compatible) versions of HTML with new features will be released with
higher version numbers.
</P>
<P>
HTML is an application of ISO Standard 8879:1986 <EM>Information
Processing Text and Office Systems; Standard Generalized <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>Markup</A>
Language</EM> (SGML). The <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML Document</A> Type Definition (<A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A>) is a
formal definition of the HTML syntax in terms of SGML.
</P>
<P>
This specification also defines HTML as an Internet <A HREF="html-spec.html#GLOSS22" REL=GLOSSARY>Media Type</A><A HREF="html-spec.html#BIB8" REL=BIBLIOGRAPHY>[IMEDIA]</A>
and MIME Content Type<A HREF="html-spec.html#BIB4" REL=BIBLIOGRAPHY>[MIME]</A> called <SAMP>`text/html'</SAMP>. As such, it
defines the semantics of the HTML syntax and how that syntax <A HREF="html-spec.html#GLOSS29" REL=GLOSSARY>should</A> be
interpreted by user agents.
</P>
<H2><A NAME="SEC1.2" HREF="html-spec_toc.html#SEC1.2" REL=TOC>Conformance</A></H2>
<P>
This specification governs the syntax of HTML documents and aspects of
the behavior of HTML user agents.
</P>
<H3><A NAME="SEC1.2.1" HREF="html-spec_toc.html#SEC1.2.1" REL=TOC>Documents</A></H3>
<P>
A document is a conforming <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML document</A> if:
</P>
<UL>
<LI>
It is a conforming <A HREF="html-spec.html#GLOSS27" REL=GLOSSARY>SGML document</A>, and it conforms to the HTML <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A>
(see section <A HREF="html-spec.html#SEC9.1" REL=XREF>HTML DTD</A>).
<A NAME="FOOT1" HREF="html-spec_foot.html#FOOT1" REL=FOOTNOTE>(1)</A>
<LI>
It conforms to the application conventions in this
specification. For example, the value of the <EM>HREF</EM> attribute of
the <EM>A</EM> <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> <A HREF="html-spec.html#GLOSS25" REL=GLOSSARY>must</A> conform to the <A HREF="html-spec.html#GLOSS35" REL=GLOSSARY>URI</A> syntax.
<LI>
Its <A HREF="html-spec.html#GLOSS11" REL=GLOSSARY>document character set</A> includes <A HREF="html-spec.html#BIB13" REL=BIBLIOGRAPHY>[ISO-8859-1]</A> and agrees with
<A HREF="html-spec.html#BIB12" REL=BIBLIOGRAPHY>[ISO-10646]</A>; that is, each <A HREF="html-spec.html#GLOSS7" REL=GLOSSARY>code position</A> listed in section <A HREF="html-spec.html#SEC13" REL=XREF>The HTML Coded Character Set</A> is included, and each <A HREF="html-spec.html#GLOSS7" REL=GLOSSARY>code position</A> in the document
<A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> set is mapped to the same <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> as <A HREF="html-spec.html#BIB12" REL=BIBLIOGRAPHY>[ISO-10646]</A> designates
for that <A HREF="html-spec.html#GLOSS7" REL=GLOSSARY>code position</A>.
<A NAME="FOOT2" HREF="html-spec_foot.html#FOOT2" REL=FOOTNOTE>(2)</A>
</UL>
<H3><A NAME="SEC1.2.2" HREF="html-spec_toc.html#SEC1.2.2" REL=TOC>Feature Test Entities</A></H3>
<P>
The HTML <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> defines a standard <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML document</A> type and several
variations, by way of feature test entities. Feature test entities
are declarations in the HTML <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> that control the inclusion or
exclusion of portions of the <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A>.
</P>
<DL COMPACT>
<DT><EM>HTML.Recommended</EM>
<DD>
Certain features of the language are
necessary for compatibility with widespread usage, but they <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A>
compromise the structural integrity of a document. This feature test
<A HREF="html-spec.html#GLOSS15" REL=GLOSSARY>entity</A> selects a more prescriptive document type definition that
eliminates those features. It is set to <SAMP>`IGNORE'</SAMP> by default.
For example, in order to preserve the structure of a document, an
editing <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A> <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> translate HTML documents to the recommended
subset, or it <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> require that the documents be in the recommended
subset for import.
<DT><EM>HTML.Deprecated</EM>
<DD>
Certain features of the language are
necessary for compatibility with earlier versions of the
specification, but they tend to be used and implemented inconsistently,
and their use is deprecated. This feature test <A HREF="html-spec.html#GLOSS15" REL=GLOSSARY>entity</A> enables a
document type definition that allows these features.
It is set to <SAMP>`INCLUDE'</SAMP> by default.
Documents generated by translation software or editing software <A HREF="html-spec.html#GLOSS29" REL=GLOSSARY>should</A>
not contain deprecated idioms.
</DL>
<H3><A NAME="SEC1.2.3" HREF="html-spec_toc.html#SEC1.2.3" REL=TOC>User Agents</A></H3>
<P>
An HTML <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A> conforms to this specification if:
</P>
<UL>
<LI>
It parses the characters of an <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML document</A> into data characters
and <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> according to <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>.
<A NAME="FOOT3" HREF="html-spec_foot.html#FOOT3" REL=FOOTNOTE>(3)</A>
<LI>
It supports the <SAMP>`ISO-8859-1'</SAMP> <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> encoding scheme and
processes each <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> in the ISO Latin Alphabet No. 1 as specified
in section <A HREF="html-spec.html#SEC6.1" REL=XREF>The HTML Document Character Set</A>.
<A NAME="FOOT4" HREF="html-spec_foot.html#FOOT4" REL=FOOTNOTE>(4)</A>
<LI>
It behaves identically for documents whose parsed token sequences
are identical.
For example, comments and the whitespace in tags disappear during
tokenization, and hence they do not influence the behavior of
conforming user agents.
<LI>
It allows the user to traverse (or at least attempt to traverse,
resources permitting) all hyperlinks from <EM>A</EM> elements in an HTML
document.
</UL>
<P>
An HTML <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A> is a level 2 <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A> if, additionally:
</P>
<UL>
<LI>
It allows the user to express all form field values specified in
an <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML document</A> and to (attempt to) submit the values as requests to
information services.
</UL>
<H1><A NAME="SEC2" HREF="html-spec_toc.html#SEC2" REL=TOC>Terms</A></H1>
<DL COMPACT>
<DT><EM><A NAME="GLOSS1">absolute URI</A></EM>
<DD>
a <A HREF="html-spec.html#GLOSS35" REL=GLOSSARY>URI</A> in absolute form; for example, as per <A HREF="html-spec.html#BIB2" REL=BIBLIOGRAPHY>[URL]</A>
<DT><EM><A NAME="GLOSS2">anchor</A></EM>
<DD>
one of two ends of a <A HREF="html-spec.html#GLOSS19" REL=GLOSSARY>hyperlink</A>; typically, a phrase
marked as an <EM>A</EM> <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A>.
<DT><EM><A NAME="GLOSS3">base URI</A></EM>
<DD>
an <A HREF="html-spec.html#GLOSS1" REL=GLOSSARY>absolute URI</A> used in combination with a relative
<A HREF="html-spec.html#GLOSS35" REL=GLOSSARY>URI</A> to determine another <A HREF="html-spec.html#GLOSS1" REL=GLOSSARY>absolute URI</A>.
<DT><EM><A NAME="GLOSS4">character</A></EM>
<DD>
An atom of information, for example a letter or a
digit. Graphic characters have associated glyphs, whereas control
characters have associated processing semantics.
<DT><EM><A NAME="GLOSS5">character encoding scheme</A></EM>
<DD>
A function whose domain is the set of
sequences of octets, and whose range is the set of sequences of
characters from a <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> repertoire; that is, a sequence of octets
and a <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> encoding scheme determines a sequence of characters.
<DT><EM><A NAME="GLOSS6">character repertoire</A></EM>
<DD>
A finite set of characters; e.g. the range
of a <A HREF="html-spec.html#GLOSS8" REL=GLOSSARY>coded character set</A>.
<DT><EM><A NAME="GLOSS7">code position</A></EM>
<DD>
An integer. A <A HREF="html-spec.html#GLOSS8" REL=GLOSSARY>coded character set</A> and a code
position from its domain determine a <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A>.
<DT><EM><A NAME="GLOSS8">coded character set</A></EM>
<DD>
A function whose domain is a subset of the
integers and whose range is a <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> repertoire. That is, for some
set of integers (usually of the form {0, 1, 2, ..., N} ), a coded
<A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> set and an integer in that set determine a
<A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A>. Conversely, a <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> and a <A HREF="html-spec.html#GLOSS8" REL=GLOSSARY>coded character set</A> determine
the <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A>'s <A HREF="html-spec.html#GLOSS7" REL=GLOSSARY>code position</A> (or, in rare cases, a few code
positions).
<DT><EM><A NAME="GLOSS9">conforming HTML user agent</A></EM>
<DD>
A <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A> that conforms to this
specification in its processing of the Internet <A HREF="html-spec.html#GLOSS22" REL=GLOSSARY>Media Type</A>
<SAMP>`text/html'</SAMP>.
<DT><EM><A NAME="GLOSS10">data character</A></EM>
<DD>
Characters other than <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A>, which make up the
content of elements.
<DT><EM><A NAME="GLOSS11">document character set</A></EM>
<DD>
a <A HREF="html-spec.html#GLOSS8" REL=GLOSSARY>coded character set</A> whose range
includes all characters used in a document. Every <A HREF="html-spec.html#GLOSS27" REL=GLOSSARY>SGML document</A> has
exactly one <A HREF="html-spec.html#GLOSS11" REL=GLOSSARY>document character set</A>. Numeric character references are
resolved via the <A HREF="html-spec.html#GLOSS11" REL=GLOSSARY>document character set</A>.
<DT><EM><A NAME="GLOSS12">DTD</A></EM>
<DD>
document type definition. Rules that apply SGML to the
<A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> of documents of a particular type, including a set of <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A>
and <A HREF="html-spec.html#GLOSS15" REL=GLOSSARY>entity</A> declarations. <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>
<DT><EM><A NAME="GLOSS13">element</A></EM>
<DD>
A component of the hierarchical structure defined by a
document type definition; it is identified in a document instance by
descriptive <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A>, usually a <A HREF="html-spec.html#GLOSS30" REL=GLOSSARY>start-tag</A> and <A HREF="html-spec.html#GLOSS14" REL=GLOSSARY>end-tag</A>. <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>
<DT><EM><A NAME="GLOSS14">end-tag</A></EM>
<DD>
Descriptive <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> that identifies the end of an
<A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A>. <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>
<DT><EM><A NAME="GLOSS15">entity</A></EM>
<DD>
data with an associated notation or interpretation; for
example, a sequence of octets associated with an Internet Media
Type. <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>
<DT><EM><A NAME="GLOSS16">fragment identifier</A></EM>
<DD>
the portion of an <EM>HREF</EM> attribute
value following the <SAMP>`#'</SAMP> <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> which modifies the presentation
of the destination of a <A HREF="html-spec.html#GLOSS19" REL=GLOSSARY>hyperlink</A>.
<DT><EM><A NAME="GLOSS17">form data set</A></EM>
<DD>
a sequence of name/value pairs; the names are
given by an <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML document</A> and the values are given by a user.
<DT><EM><A NAME="GLOSS18">HTML document</A></EM>
<DD>
An <A HREF="html-spec.html#GLOSS27" REL=GLOSSARY>SGML document</A> conforming to this document type
definition.
<DT><EM><A NAME="GLOSS19">hyperlink</A></EM>
<DD>
a relationship between two anchors, called the head
and the tail. The link goes from the tail to the head. The head
and tail are also known as destination and source, respectively.
<DT><EM><A NAME="GLOSS20">markup</A></EM>
<DD>
Syntactically delimited characters added to the data of a
document to represent its structure. There are four different kinds of
<A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A>: descriptive <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> (tags), references, <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> declarations,
and processing instructions. <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>
<DT><EM><A NAME="GLOSS21">may</A></EM>
<DD>
A document or user interface is conforming whether this
statement applies or not.
<DT><EM><A NAME="GLOSS22">media type</A></EM>
<DD>
an Internet <A HREF="html-spec.html#GLOSS22" REL=GLOSSARY>Media Type</A>, as per <A HREF="html-spec.html#BIB8" REL=BIBLIOGRAPHY>[IMEDIA]</A>.
<DT><EM><A NAME="GLOSS23">message entity</A></EM>
<DD>
a head and body. The head is a collection of
name/value fields, and the body is a sequence of octets. The head
defines the content type and content transfer encoding of the body. <A HREF="html-spec.html#BIB4" REL=BIBLIOGRAPHY>[MIME]</A>
<DT><EM><A NAME="GLOSS24">minimally conforming HTML user agent</A></EM>
<DD>
A <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A> that conforms
to this specification except for form processing. It <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> only process
level 1 HTML documents.
<DT><EM><A NAME="GLOSS25">must</A></EM>
<DD>
Documents or user agents in conflict with this statement
are not conforming.
<DT><EM><A NAME="GLOSS26">numeric character reference</A></EM>
<DD>
<A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> that refers to a <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A>
by its <A HREF="html-spec.html#GLOSS7" REL=GLOSSARY>code position</A> in the <A HREF="html-spec.html#GLOSS11" REL=GLOSSARY>document character set</A>.
<DT><EM><A NAME="GLOSS27">SGML document</A></EM>
<DD>
A sequence of characters organized physically as a
set of entities and logically into a hierarchy of elements. An SGML
document consists of data characters and <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A>; the <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> describes
the structure of the information and an instance of that
structure. <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>
<DT><EM><A NAME="GLOSS28">shall</A></EM>
<DD>
If a document or <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A> conflicts with this statement,
it does not conform to this specification.
<DT><EM><A NAME="GLOSS29">should</A></EM>
<DD>
If a document or <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A> conflicts with this
statement, undesirable results <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> occur in practice even though it
conforms to this specification.
<DT><EM><A NAME="GLOSS30">start-tag</A></EM>
<DD>
Descriptive <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> that identifies the start of an
<A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> and specifies its generic identifier and attributes. <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>
<DT><EM><A NAME="GLOSS31">syntax-reference character set</A></EM>
<DD>
A <A HREF="html-spec.html#GLOSS8" REL=GLOSSARY>coded character set</A> whose range
includes all characters used for <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A>; e.g. name characters and
delimiter characters.
<DT><EM><A NAME="GLOSS32">tag</A></EM>
<DD>
<A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>Markup</A> that delimits an <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A>. A <A HREF="html-spec.html#GLOSS32" REL=GLOSSARY>tag</A> includes a name which
refers to an <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> declaration in the <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A>, and <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> include
attributes. <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>
<DT><EM><A NAME="GLOSS33">text entity</A></EM>
<DD>
A finite sequence of characters. A <A HREF="html-spec.html#GLOSS33" REL=GLOSSARY>text entity</A>
typically takes the form of a sequence of octets with some associated
<A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> encoding scheme, transmitted over the network or stored in a
file. <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>
<DT><EM><A NAME="GLOSS34">typical</A></EM>
<DD>
<A HREF="html-spec.html#GLOSS34" REL=GLOSSARY>Typical</A> processing is described for many elements. This
is not a mandatory part of the specification but is given as guidance
for designers and to help explain the uses for which the elements were
intended.
<DT><EM><A NAME="GLOSS35">URI</A></EM>
<DD>
A Uniform Resource Identifier is a formatted string that
serves as an identifier for a resource, typically on the Internet. URIs
are used in HTML to identify the anchors of hyperlinks. URIs in
common practice include Uniform Resource Locators (URLs)<A HREF="html-spec.html#BIB2" REL=BIBLIOGRAPHY>[URL]</A>
and Relative URLs <A HREF="html-spec.html#BIB5" REL=BIBLIOGRAPHY>[RELURL]</A>.
<DT><EM><A NAME="GLOSS36">user agent</A></EM>
<DD>
A component of a distributed system that presents
an interface and processes requests on behalf of a user; for example,
a www browser or a mail <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A>.
<DT><EM><A NAME="GLOSS37">WWW</A></EM>
<DD>
The World-Wide Web is a hypertext-based, distributed
information system created by researchers at CERN in
Switzerland. <EM>http://www.w3.org/</EM>
</DL>
<H1><A NAME="SEC3" HREF="html-spec_toc.html#SEC3" REL=TOC>HTML as an Application of SGML</A></H1>
<P>
HTML is an application of ISO 8879:1986 -- Standard
Generalized <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>Markup</A> Language (SGML). SGML is a system for defining
structured document types and <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> languages to represent instances
of those document types<A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>. The public text -- <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> and SGML
declaration -- of the <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML document</A> type definition are provided in
section <A HREF="html-spec.html#SEC9" REL=XREF>HTML Public Text</A>.
</P>
<P>
The term <EM>HTML</EM> refers to both the document type defined here and
the <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> language for representing instances of this document type.
</P>
<H2><A NAME="SEC3.1" HREF="html-spec_toc.html#SEC3.1" REL=TOC>SGML Documents</A></H2>
<P>
An <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML document</A> is an <A HREF="html-spec.html#GLOSS27" REL=GLOSSARY>SGML document</A>; that is, a sequence of
characters organized physically into a set of entities, and logically
as a hierarchy of elements.
</P>
<P>
In the SGML specification, the first production of the SGML syntax
grammar separates an <A HREF="html-spec.html#GLOSS27" REL=GLOSSARY>SGML document</A> into three parts: an SGML
declaration, a prologue, and an instance. For the purposes of this
specification, the prologue is a <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A>. This <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> describes another
grammar: the start symbol is given in the doctype declaration, the
terminals are data characters and tags, and the productions are
determined by the <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> declarations. The instance <A HREF="html-spec.html#GLOSS25" REL=GLOSSARY>must</A> conform to
the <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A>, that is, it <A HREF="html-spec.html#GLOSS25" REL=GLOSSARY>must</A> be in the language defined by this grammar.
</P>
<P>
The SGML declaration determines the lexicon of the grammar. It
specifies the <A HREF="html-spec.html#GLOSS11" REL=GLOSSARY>document character set</A>, which determines a
<A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> repertoire that contains all characters that occur in all
text entities in the document, and the code positions associated with
those characters.
</P>
<P>
The SGML declaration also specifies the <A HREF="html-spec.html#GLOSS31" REL=GLOSSARY>syntax-reference character set</A>
of the document, and a few other parameters that bind the abstract
syntax of SGML to a concrete syntax. This concrete syntax determines
how the sequence of characters of the document is mapped to a sequence
of terminals in the grammar of the prologue.
</P>
<P>
For example, consider the following document:
</P>
<PRE>
<!DOCTYPE html PUBLIC "-//IETF//<A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN">
<title>Parsing Example</title>
<p>Some text. <em>&#42;wow&#42;</em></p>
</PRE>
<P>
An HTML <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A> <A HREF="html-spec.html#GLOSS29" REL=GLOSSARY>should</A> use the SGML declaration that is given in
section <A HREF="html-spec.html#SEC9.5" REL=XREF>SGML Declaration for HTML</A>. According to its <A HREF="html-spec.html#GLOSS11" REL=GLOSSARY>document character set</A>,
<SAMP>`&#42;'</SAMP> refers to an asterisk <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A>, <SAMP>`*'</SAMP>.
</P>
<P>
The instance above is regarded as the following sequence of terminals:
</P>
<OL>
<LI>
<A HREF="html-spec.html#GLOSS30" REL=GLOSSARY>start-tag</A>: TITLE
<LI>
data characters: "Parsing Example"
<LI>
<A HREF="html-spec.html#GLOSS14" REL=GLOSSARY>end-tag</A>: TITLE
<LI>
<A HREF="html-spec.html#GLOSS30" REL=GLOSSARY>start-tag</A>: P
<LI>
data characters "Some text. "
<LI>
<A HREF="html-spec.html#GLOSS30" REL=GLOSSARY>start-tag</A>: EM
<LI>
data characters: "*wow*"
<LI>
<A HREF="html-spec.html#GLOSS14" REL=GLOSSARY>end-tag</A>: EM
<LI>
<A HREF="html-spec.html#GLOSS14" REL=GLOSSARY>end-tag</A>: P
</OL>
<P>
The start symbol of the <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> grammar is HTML, and the productions
are given in the public text identified by <SAMP>`-//IETF//<A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN'</SAMP> (section <A HREF="html-spec.html#SEC9.1" REL=XREF>HTML DTD</A>). The terminals above parse as:
</P>
<PRE>
HTML
|
\-HEAD
| |
| \-TITLE
| |
| \-<TITLE>
| |
| \-"Parsing Example"
| |
| \-</TITLE>
|
\-BODY
|
\-P
|
\-<P>
|
\-"Some text. "
|
\-EM
| |
| \-<EM>
| |
| \-"*wow*"
| |
| \-</EM>
|
\-</P>
</PRE>
<P>
Some of the elements are delimited explicitly by tags, while the
boundaries of others are inferred. The <EM>HTML</EM> <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> contains a
<EM>HEAD</EM> <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> and a <EM>BODY</EM> <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A>. The <EM>HEAD</EM> contains
<EM>TITLE</EM>, which is explicitly delimited by start- and end-tags.
</P>
<H2><A NAME="SEC3.2" HREF="html-spec_toc.html#SEC3.2" REL=TOC>HTML Lexical Syntax</A></H2>
<P>
SGML specifies an abstract syntax and a reference concrete
syntax. Aside from certain quantities and capacities (e.g. the limit
on the length of a name), all HTML documents use the reference
concrete syntax. In particular, all <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> characters are in the
repertoire of <A HREF="html-spec.html#BIB11" REL=BIBLIOGRAPHY>[ISO-646]</A>. Data characters are drawn from the document
<A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> set (see section <A HREF="html-spec.html#SEC6" REL=XREF>Characters, Words, and Paragraphs</A>).
</P>
<P>
A complete discussion of SGML parsing, e.g. the mapping of a sequence
of characters to a sequence of tags and data, is left to the SGML
standard<A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>. This section is only a summary.
</P>
<H3><A NAME="SEC3.2.1" HREF="html-spec_toc.html#SEC3.2.1" REL=TOC>Data Characters</A></H3>
<P>
Any sequence of characters that do not constitute <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> (see
9.6 "Delimiter Recognition" of <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>) are mapped directly to
strings of data characters. Some <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> also maps to <A HREF="html-spec.html#GLOSS10" REL=GLOSSARY>data character</A>
strings. Numeric character references map to single-<A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A>
strings, via the <A HREF="html-spec.html#GLOSS11" REL=GLOSSARY>document character set</A>. Each reference to one of the
general entities defined in the HTML <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> maps to a
single-<A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> string.
</P>
<P>
For example,
</P>
<PRE>
abc&lt;def => "abc","<","def"
abc&#60;def => "abc","<","def"
</PRE>
<P>
The terminating semicolon on <A HREF="html-spec.html#GLOSS15" REL=GLOSSARY>entity</A> or numeric character references is
only necessary when the <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> following the reference would
otherwise be recognized as part of the name (see 9.4.5 "Reference End"
in <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>).
</P>
<PRE>
abc &lt def => "abc ","<"," def"
abc &#60 def => "abc ","<"," def"
</PRE>
<P>
An ampersand is only recognized as <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> when it is followed by a
letter or a <SAMP>`#'</SAMP> and a digit:
</P>
<PRE>
abc & lt def => "abc & lt def"
abc &# 60 def => "abc &# 60 def"
</PRE>
<P>
A useful technique for translating plain text to HTML is to replace
each '<', '&', and '>' by an <A HREF="html-spec.html#GLOSS15" REL=GLOSSARY>entity</A> reference or numeric <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A>
reference as follows:
</P>
<PRE>
ENTITY NUMERIC
CHARACTER REFERENCE CHAR REF CHARACTER DESCRIPTION
--------- ---------- ----------- ---------------------
& &amp; &#38; Ampersand
< &lt; &#60; Less than
> &gt; &#62; Greater than
</PRE>
<P>
<A NAME="FOOT5" HREF="html-spec_foot.html#FOOT5" REL=FOOTNOTE>(5)</A>
</P>
<H3><A NAME="SEC3.2.2" HREF="html-spec_toc.html#SEC3.2.2" REL=TOC>Tags</A></H3>
<P>
Tags delimit elements such as headings, paragraphs, lists, <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A>
highlighting, and links. Most HTML elements are identified in a
document as a <A HREF="html-spec.html#GLOSS30" REL=GLOSSARY>start-tag</A>, which gives the <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> name and attributes,
followed by the content, followed by the end <A HREF="html-spec.html#GLOSS32" REL=GLOSSARY>tag</A>. Start-tags are
delimited by <SAMP>`<'</SAMP> and <SAMP>`>'</SAMP>; end tags are delimited by
<SAMP>`</'</SAMP> and <SAMP>`>'</SAMP>. An example is:
</P>
<PRE>
<H1>This is a Heading</H1>
</PRE>
<P>
Some elements only have a <A HREF="html-spec.html#GLOSS30" REL=GLOSSARY>start-tag</A> without an <A HREF="html-spec.html#GLOSS14" REL=GLOSSARY>end-tag</A>. For example,
to create a line break, use the <SAMP>`<BR>'</SAMP> <A HREF="html-spec.html#GLOSS32" REL=GLOSSARY>tag</A>. Additionally,
the end tags of some other elements, such as Paragraph
(<SAMP>`</P>'</SAMP>), List Item (<SAMP>`</LI>'</SAMP>), Definition Term
(<SAMP>`</DT>'</SAMP>), and Definition Description (<SAMP>`</DD>'</SAMP>)
elements, <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> be omitted.
</P>
<P>
The content of an <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> is a sequence of <A HREF="html-spec.html#GLOSS10" REL=GLOSSARY>data character</A> strings and nested
elements. Some elements, such as anchors, cannot be nested. Anchors
and <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> highlighting <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> be put inside other constructs. See
the HTML <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A>, section <A HREF="html-spec.html#SEC9.1" REL=XREF>HTML DTD</A> for full details.
<A NAME="FOOT6" HREF="html-spec_foot.html#FOOT6" REL=FOOTNOTE>(6)</A>
</P>
<H3><A NAME="SEC3.2.3" HREF="html-spec_toc.html#SEC3.2.3" REL=TOC>Names</A></H3>
<P>
A name consists of a letter followed by letters, digits, periods, or
hyphens. The length of a name is limited to 72 characters by the
<SAMP>`NAMELEN'</SAMP> parameter in the SGML declaration for HTML, section <A HREF="html-spec.html#SEC9.5" REL=XREF>SGML Declaration for HTML</A>. <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>Element</A> and attribute names are not case sensitive, but
<A HREF="html-spec.html#GLOSS15" REL=GLOSSARY>entity</A> names are. For example, <SAMP>`<BLOCKQUOTE>'</SAMP>,
<SAMP>`<BlockQuote>'</SAMP>, and <SAMP>`<blockquote>'</SAMP> are equivalent,
whereas <SAMP>`&amp;'</SAMP> is different from <SAMP>`&AMP;'</SAMP>.
</P>
<P>
In a <A HREF="html-spec.html#GLOSS30" REL=GLOSSARY>start-tag</A>, the <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> name <A HREF="html-spec.html#GLOSS25" REL=GLOSSARY>must</A> immediately follow the <A HREF="html-spec.html#GLOSS32" REL=GLOSSARY>tag</A>
open delimiter <SAMP>`<'</SAMP>.
</P>
<H3><A NAME="SEC3.2.4" HREF="html-spec_toc.html#SEC3.2.4" REL=TOC>Attributes</A></H3>
<P>
In a <A HREF="html-spec.html#GLOSS30" REL=GLOSSARY>start-tag</A>, white space and attributes are allowed between the
<A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> name and the closing delimiter. An attribute specification
typically consists of an attribute name, an equal sign, and a value,
though some attribute specifications <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> be just a name token. White
space is allowed around the equal sign.
</P>
<P>
The value of the attribute <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> be either:
</P>
<UL>
<LI>
A string literal, delimited by single quotes or double quotes and
not containing any occurrences of the delimiting <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A>.
<A NAME="FOOT7" HREF="html-spec_foot.html#FOOT7" REL=FOOTNOTE>(7)</A>
<LI>
A name token (a sequence of letters, digits, periods, or hyphens).
Name tokens are not case sensitive.
<A NAME="FOOT8" HREF="html-spec_foot.html#FOOT8" REL=FOOTNOTE>(8)</A>
</UL>
<P>
In this example, <EM>img</EM> is the <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A> name, <EM>src</EM> is the
attribute name, and <SAMP>`http://host/dir/file.gif'</SAMP> is the
attribute value:
</P>
<PRE>
<img src='http://host/dir/file.gif'>
</PRE>
<P>
A useful technique for computing an attribute value literal for a
given string is to replace each quote and white space <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> by an
<A HREF="html-spec.html#GLOSS15" REL=GLOSSARY>entity</A> reference or <A HREF="html-spec.html#GLOSS26" REL=GLOSSARY>numeric character reference</A> as follows:
</P>
<PRE>
ENTITY NUMERIC
CHARACTER REFERENCE CHAR REF CHARACTER DESCRIPTION
--------- ---------- ----------- ---------------------
HT &#9; Tab
LF &#10; Line Feed
CR &#13; Carriage Return
SP &#32; Space
" &quot; &#34; Quotation mark
& &amp; &#38; Ampersand
</PRE>
<P>
For example:
</P>
<PRE>
<IMG SRC="image.jpg" alt="First &quot;real&quot; example">
</PRE>
<P>
The <SAMP>`NAMELEN'</SAMP> parameter in the SGML declaration (section <A HREF="html-spec.html#SEC9.5" REL=XREF>SGML Declaration for HTML</A>) limits the length of an attribute value to 1024
characters.
</P>
<P>
Attributes such as ISMAP and COMPACT <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> be written using a minimized
syntax (see 7.9.1.2 "Omitted Attribute Name" in <A HREF="html-spec.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>). The <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A>:
</P>
<PRE>
<UL COMPACT="compact">
</PRE>
<P>
can be written using a minimized syntax:
</P>
<PRE>
<UL COMPACT>
</PRE>
<P>
<A NAME="FOOT9" HREF="html-spec_foot.html#FOOT9" REL=FOOTNOTE>(9)</A>
</P>
<H3><A NAME="SEC3.2.5" HREF="html-spec_toc.html#SEC3.2.5" REL=TOC>Comments</A></H3>
<P>
To include comments in an <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML document</A>, use a comment declaration. A
comment declaration consists of <SAMP>`<!'</SAMP> followed by zero or more
comments followed by <SAMP>`>'</SAMP>. Each comment starts with <SAMP>`--'</SAMP> and
includes all text up to and including the next occurrence of
<SAMP>`--'</SAMP>. In a comment declaration, white space is allowed after
each comment, but not before the first comment. The entire comment
declaration is ignored.
<A NAME="FOOT10" HREF="html-spec_foot.html#FOOT10" REL=FOOTNOTE>(10)</A>
</P>
<P>
For example:
</P>
<PRE>
<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN">
<HEAD>
<TITLE>HTML Comment Example</TITLE>
<!-- Id: html-sgml.sgm,v 1.5 1995/05/26 21:29:50 connolly Exp -->
<!-- another -- -- comment -->
<!>
</HEAD>
<BODY>
<p> <!- not a comment, just regular old data characters ->
</PRE>
<H2><A NAME="SEC3.3" HREF="html-spec_toc.html#SEC3.3" REL=TOC>HTML Public Text Identifiers</A></H2>
<P>
To identify information as an <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML document</A> conforming to this
specification, each document <A HREF="html-spec.html#GLOSS25" REL=GLOSSARY>must</A> start with one of the following
document type declarations.
</P>
<PRE>
<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN">
</PRE>
<P>
This document type declaration refers to the HTML <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> in section <A HREF="html-spec.html#SEC9.1" REL=XREF>HTML DTD</A>.
<A NAME="FOOT11" HREF="html-spec_foot.html#FOOT11" REL=FOOTNOTE>(11)</A>
</P>
<PRE>
<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Level 2//EN">
</PRE>
<P>
This document type declaration also refers to the HTML <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> which
appears in section <A HREF="html-spec.html#SEC9.1" REL=XREF>HTML DTD</A>.
</P>
<PRE>
<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Level 1//EN">
</PRE>
<P>
This document type declaration refers to the level 1 HTML <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> in
section <A HREF="html-spec.html#SEC9.3" REL=XREF>Level 1 HTML DTD</A>. Form elements <A HREF="html-spec.html#GLOSS25" REL=GLOSSARY>must</A> not occur in level 1
documents.
</P>
<PRE>
<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Strict//EN">
<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Strict Level 1//EN">
</PRE>
<P>
These two document type declarations refer to the HTML <A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> in section <A HREF="html-spec.html#SEC9.2" REL=XREF>Strict HTML DTD</A> and section <A HREF="html-spec.html#SEC9.4" REL=XREF>Strict Level 1 HTML DTD</A>. They refer to the more
structurally rigid definition of HTML.
</P>
<P>
HTML user agents <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> support other document types. In particular,
they <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> support other formal public identifiers, or other document
types altogether. They <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> support an internal declaration subset with
supplemental <A HREF="html-spec.html#GLOSS15" REL=GLOSSARY>entity</A>, <A HREF="html-spec.html#GLOSS13" REL=GLOSSARY>element</A>, and other <A HREF="html-spec.html#GLOSS20" REL=GLOSSARY>markup</A> declarations.
</P>
<H2><A NAME="SEC3.4" HREF="html-spec_toc.html#SEC3.4" REL=TOC>Example HTML Document</A></H2>
<PRE>
<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN">
<HTML>
<!-- Here's a good place to put a comment. -->
<HEAD>
<TITLE>Structural Example</TITLE>
</HEAD><BODY>
<H1>First Header</H1>
<P>This is a paragraph in the example HTML file. Keep in mind
that the title does not appear in the document text, but that
the header (defined by H1) does.</P>
<OL>
<LI>First item in an ordered list.
<LI>Second item in an ordered list.
<UL COMPACT>
<LI> Note that lists can be nested;
<LI> Whitespace <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> be used to assist in reading the
HTML source.
</UL>
<LI>Third item in an ordered list.
</OL>
<P>This is an additional paragraph. Technically, end tags are
not required for paragraphs, although they are allowed. You can
include <A HREF="html-spec.html#GLOSS4" REL=GLOSSARY>character</A> highlighting in a paragraph. <EM>This sentence
of the paragraph is emphasized.</EM> Note that the &lt;/P&gt;
end <A HREF="html-spec.html#GLOSS32" REL=GLOSSARY>tag</A> has been omitted.
<P>
<IMG SRC ="triangle.xbm" alt="Warning: ">
Be sure to read these <b>bold instructions</b>.
</BODY></HTML>
</PRE>
<H1><A NAME="SEC4" HREF="html-spec_toc.html#SEC4" REL=TOC>HTML as an Internet Media Type</A></H1>
<P>
An HTML <A HREF="html-spec.html#GLOSS36" REL=GLOSSARY>user agent</A> allows users to interact with resources which have
HTML representations. At a minimum, it <A HREF="html-spec.html#GLOSS25" REL=GLOSSARY>must</A> allow users to examine and
navigate the content of HTML level 1 documents. HTML user agents
<A HREF="html-spec.html#GLOSS29" REL=GLOSSARY>should</A> be able to preserve all formatting distinctions represented in
an <A HREF="html-spec.html#GLOSS18" REL=GLOSSARY>HTML document</A>, and be able to simultaneously present resources
referred to by IMG elements (they <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> ignore some formatting
distinctions or IMG resources at the request of the user). Level 2
HTML user agents <A HREF="html-spec.html#GLOSS29" REL=GLOSSARY>should</A> support form entry and submission.
</P>
<H2><A NAME="SEC4.1" HREF="html-spec_toc.html#SEC4.1" REL=TOC>text/html media type</A></H2>
<P>
This specification defines the Internet <A HREF="html-spec.html#GLOSS22" REL=GLOSSARY>Media Type</A><A HREF="html-spec.html#BIB8" REL=BIBLIOGRAPHY>[IMEDIA]</A> (formerly
referred to as the Content Type<A HREF="html-spec.html#BIB4" REL=BIBLIOGRAPHY>[MIME]</A>) called <SAMP>`text/html'</SAMP>. The
following is to be registered with <A HREF="html-spec.html#BIB9" REL=BIBLIOGRAPHY>[IANA]</A>.
</P>
<DL COMPACT>
<DT><EM><A HREF="html-spec.html#GLOSS22" REL=GLOSSARY>Media Type</A> name</EM>
<DD>
text
<DT><EM>Media subtype name</EM>
<DD>
html
<DT><EM>Required parameters</EM>
<DD>
none
<DT><EM>Optional parameters</EM>
<DD>
level, charset
<DT><EM>Encoding considerations</EM>
<DD>
any encoding is allowed
<DT><EM>Security considerations</EM>
<DD>
see section <A HREF="html-spec.html#SEC10" REL=XREF>Security Considerations</A>
</DL>
<P>
The optional parameters are defined as follows:
</P>
<DL COMPACT>
<DT><EM>Level</EM>
<DD>
The level parameter specifies the feature set used in the
document. The level is an integer number, implying that any features
of same or lower level <A HREF="html-spec.html#GLOSS21" REL=GLOSSARY>may</A> be present in the document. Level 1 is all