FANDOM


<

| class="webkit-line-content"|<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//EN"><HTML>


| class="webkit-line-number"| | class="webkit-line-content"|<HEAD>


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|<TITLE>Hypertext Markup Language - 2.0 - HTML as an Application of SGML</TITLE>


| class="webkit-line-number"| | class="webkit-line-content"|</HEAD>


| class="webkit-line-number"| | class="webkit-line-content"|<BODY>


| class="webkit-line-number"| | class="webkit-line-content"|Go to the <A HREF="html-spec_1.html" REL=FIRST>first</A>, <A HREF="html-spec_2.html" REL=PREVIOUS>previous</A>, <A HREF="html-spec_4.html" REL=NEXT>next</A>, <A HREF="html-spec_14.html" REL=LAST>last</A> section, <A HREF="html-spec_toc.html" REL=TOC>table of contents</A>.


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

<A NAME="SEC3" HREF="html-spec_toc.html#SEC3" REL=TOC>HTML as an Application of SGML</A>


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|HTML is an application of ISO 8879:1986 -- Standard | class="webkit-line-number"| | class="webkit-line-content"|Generalized <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>Markup</A> Language (SGML). SGML is a system for defining | class="webkit-line-number"| | class="webkit-line-content"|structured document types and <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> languages to represent instances | class="webkit-line-number"| | class="webkit-line-content"|of those document types<A HREF="html-spec_11.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>. The public text -- <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> and SGML | class="webkit-line-number"| | class="webkit-line-content"|declaration -- of the <A HREF="html-spec_2.html#GLOSS18" REL=GLOSSARY>HTML document</A> type definition are provided in | class="webkit-line-number"| | class="webkit-line-content"|section <A HREF="html-spec_9.html#SEC9" REL=XREF>HTML Public Text</A>. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|The term HTML refers to both the document type defined here and | class="webkit-line-number"| | class="webkit-line-content"|the <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> language for representing instances of this document type. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

<A NAME="SEC3.1" HREF="html-spec_toc.html#SEC3.1" REL=TOC>SGML Documents</A>


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|An <A HREF="html-spec_2.html#GLOSS18" REL=GLOSSARY>HTML document</A> is an <A HREF="html-spec_2.html#GLOSS27" REL=GLOSSARY>SGML document</A>; that is, a sequence of | class="webkit-line-number"| | class="webkit-line-content"|characters organized physically into a set of entities, and logically | class="webkit-line-number"| | class="webkit-line-content"|as a hierarchy of elements. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|In the SGML specification, the first production of the SGML syntax | class="webkit-line-number"| | class="webkit-line-content"|grammar separates an <A HREF="html-spec_2.html#GLOSS27" REL=GLOSSARY>SGML document</A> into three parts: an SGML | class="webkit-line-number"| | class="webkit-line-content"|declaration, a prologue, and an instance. For the purposes of this | class="webkit-line-number"| | class="webkit-line-content"|specification, the prologue is a <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A>. This <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> describes another | class="webkit-line-number"| | class="webkit-line-content"|grammar: the start symbol is given in the doctype declaration, the | class="webkit-line-number"| | class="webkit-line-content"|terminals are data characters and tags, and the productions are | class="webkit-line-number"| | class="webkit-line-content"|determined by the <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> declarations. The instance <A HREF="html-spec_2.html#GLOSS25" REL=GLOSSARY>must</A> conform to | class="webkit-line-number"| | class="webkit-line-content"|the <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A>, that is, it <A HREF="html-spec_2.html#GLOSS25" REL=GLOSSARY>must</A> be in the language defined by this grammar. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|The SGML declaration determines the lexicon of the grammar. It | class="webkit-line-number"| | class="webkit-line-content"|specifies the <A HREF="html-spec_2.html#GLOSS11" REL=GLOSSARY>document character set</A>, which determines a | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> repertoire that contains all characters that occur in all | class="webkit-line-number"| | class="webkit-line-content"|text entities in the document, and the code positions associated with | class="webkit-line-number"| | class="webkit-line-content"|those characters. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|The SGML declaration also specifies the <A HREF="html-spec_2.html#GLOSS31" REL=GLOSSARY>syntax-reference character set</A> | class="webkit-line-number"| | class="webkit-line-content"|of the document, and a few other parameters that bind the abstract | class="webkit-line-number"| | class="webkit-line-content"|syntax of SGML to a concrete syntax. This concrete syntax determines | class="webkit-line-number"| | class="webkit-line-content"|how the sequence of characters of the document is mapped to a sequence | class="webkit-line-number"| | class="webkit-line-content"|of terminals in the grammar of the prologue. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|For example, consider the following document: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<!DOCTYPE html PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN">


| class="webkit-line-number"|
| class="webkit-line-content"|<title>Parsing Example</title>


| class="webkit-line-number"|
| class="webkit-line-content"|<p>Some text. <em>&#42;wow&#42;</em></p>


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|An HTML <A HREF="html-spec_2.html#GLOSS36" REL=GLOSSARY>user agent</A> <A HREF="html-spec_2.html#GLOSS29" REL=GLOSSARY>should</A> use the SGML declaration that is given in | class="webkit-line-number"| | class="webkit-line-content"|section <A HREF="html-spec_9.html#SEC9.5" REL=XREF>SGML Declaration for HTML</A>. According to its <A HREF="html-spec_2.html#GLOSS11" REL=GLOSSARY>document character set</A>, | class="webkit-line-number"| | class="webkit-line-content"|`&#42;' refers to an asterisk <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A>, `*'. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|The instance above is regarded as the following sequence of terminals: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|
    | class="webkit-line-number"| | class="webkit-line-content"|
  1. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>: TITLE | class="webkit-line-number"| | class="webkit-line-content"|
  2. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|data characters: "Parsing Example" | class="webkit-line-number"| | class="webkit-line-content"|
  3. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS14" REL=GLOSSARY>end-tag</A>: TITLE | class="webkit-line-number"| | class="webkit-line-content"|
  4. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>: P | class="webkit-line-number"| | class="webkit-line-content"|
  5. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|data characters "Some text. " | class="webkit-line-number"| | class="webkit-line-content"|
  6. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>: EM | class="webkit-line-number"| | class="webkit-line-content"|
  7. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|data characters: "*wow*" | class="webkit-line-number"| | class="webkit-line-content"|
  8. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS14" REL=GLOSSARY>end-tag</A>: EM | class="webkit-line-number"| | class="webkit-line-content"|
  9. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS14" REL=GLOSSARY>end-tag</A>: P | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|The start symbol of the <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> grammar is HTML, and the productions | class="webkit-line-number"| | class="webkit-line-content"|are given in the public text identified by `-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN' (section <A HREF="html-spec_9.html#SEC9.1" REL=XREF>HTML DTD</A>). The terminals above parse as: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|HTML


| class="webkit-line-number"|
| class="webkit-line-content"||


| class="webkit-line-number"|
| class="webkit-line-content"|\-HEAD


| class="webkit-line-number"|
| class="webkit-line-content"|| |


| class="webkit-line-number"|
| class="webkit-line-content"|| \-TITLE


| class="webkit-line-number"|
| class="webkit-line-content"|| |


| class="webkit-line-number"|
| class="webkit-line-content"|| \-<TITLE>


| class="webkit-line-number"|
| class="webkit-line-content"|| |


| class="webkit-line-number"|
| class="webkit-line-content"|| \-"Parsing Example"


| class="webkit-line-number"|
| class="webkit-line-content"|| |


| class="webkit-line-number"|
| class="webkit-line-content"|| \-</TITLE>


| class="webkit-line-number"|
| class="webkit-line-content"||


| class="webkit-line-number"|
| class="webkit-line-content"|\-BODY


| class="webkit-line-number"|
| class="webkit-line-content"||


| class="webkit-line-number"|
| class="webkit-line-content"|\-P


| class="webkit-line-number"|
| class="webkit-line-content"||


| class="webkit-line-number"|
| class="webkit-line-content"|\-<P>


| class="webkit-line-number"|
| class="webkit-line-content"||


| class="webkit-line-number"|
| class="webkit-line-content"|\-"Some text. "


| class="webkit-line-number"|
| class="webkit-line-content"||


| class="webkit-line-number"|
| class="webkit-line-content"|\-EM


| class="webkit-line-number"|
| class="webkit-line-content"|| |


| class="webkit-line-number"|
| class="webkit-line-content"|| \-<EM>


| class="webkit-line-number"|
| class="webkit-line-content"|| |


| class="webkit-line-number"|
| class="webkit-line-content"|| \-"*wow*"


| class="webkit-line-number"|
| class="webkit-line-content"|| |


| class="webkit-line-number"|
| class="webkit-line-content"|| \-</EM>


| class="webkit-line-number"|
| class="webkit-line-content"||


| class="webkit-line-number"|
| class="webkit-line-content"|\-</P>


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|Some of the elements are delimited explicitly by tags, while the | class="webkit-line-number"| | class="webkit-line-content"|boundaries of others are inferred. The HTML <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> contains a | class="webkit-line-number"| | class="webkit-line-content"|HEAD <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> and a BODY <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A>. The HEAD contains | class="webkit-line-number"| | class="webkit-line-content"|TITLE, which is explicitly delimited by start- and end-tags. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

<A NAME="SEC3.2" HREF="html-spec_toc.html#SEC3.2" REL=TOC>HTML Lexical Syntax</A>


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|SGML specifies an abstract syntax and a reference concrete | class="webkit-line-number"| | class="webkit-line-content"|syntax. Aside from certain quantities and capacities (e.g. the limit | class="webkit-line-number"| | class="webkit-line-content"|on the length of a name), all HTML documents use the reference | class="webkit-line-number"| | class="webkit-line-content"|concrete syntax. In particular, all <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> characters are in the | class="webkit-line-number"| | class="webkit-line-content"|repertoire of <A HREF="html-spec_11.html#BIB11" REL=BIBLIOGRAPHY>[ISO-646]</A>. Data characters are drawn from the document | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> set (see section <A HREF="html-spec_6.html#SEC6" REL=XREF>Characters, Words, and Paragraphs</A>). | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|A complete discussion of SGML parsing, e.g. the mapping of a sequence | class="webkit-line-number"| | class="webkit-line-content"|of characters to a sequence of tags and data, is left to the SGML | class="webkit-line-number"| | class="webkit-line-content"|standard<A HREF="html-spec_11.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>. This section is only a summary. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

<A NAME="SEC3.2.1" HREF="html-spec_toc.html#SEC3.2.1" REL=TOC>Data Characters</A>


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|Any sequence of characters that do not constitute <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> (see | class="webkit-line-number"| | class="webkit-line-content"|9.6 "Delimiter Recognition" of <A HREF="html-spec_11.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>) are mapped directly to | class="webkit-line-number"| | class="webkit-line-content"|strings of data characters. Some <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> also maps to <A HREF="html-spec_2.html#GLOSS10" REL=GLOSSARY>data character</A> | class="webkit-line-number"| | class="webkit-line-content"|strings. Numeric character references map to single-<A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> | class="webkit-line-number"| | class="webkit-line-content"|strings, via the <A HREF="html-spec_2.html#GLOSS11" REL=GLOSSARY>document character set</A>. Each reference to one of the | class="webkit-line-number"| | class="webkit-line-content"|general entities defined in the HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> maps to a | class="webkit-line-number"| | class="webkit-line-content"|single-<A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> string. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|For example, | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|abc&lt;def => "abc","<","def"


| class="webkit-line-number"|
| class="webkit-line-content"|abc&#60;def => "abc","<","def"


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|The terminating semicolon on <A HREF="html-spec_2.html#GLOSS15" REL=GLOSSARY>entity</A> or numeric character references is | class="webkit-line-number"| | class="webkit-line-content"|only necessary when the <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> following the reference would | class="webkit-line-number"| | class="webkit-line-content"|otherwise be recognized as part of the name (see 9.4.5 "Reference End" | class="webkit-line-number"| | class="webkit-line-content"|in <A HREF="html-spec_11.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>). | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|abc &lt def => "abc ","<"," def"


| class="webkit-line-number"|
| class="webkit-line-content"|abc &#60 def => "abc ","<"," def"


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|An ampersand is only recognized as <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> when it is followed by a | class="webkit-line-number"| | class="webkit-line-content"|letter or a `#' and a digit: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|abc & lt def => "abc & lt def"


| class="webkit-line-number"|
| class="webkit-line-content"|abc &# 60 def => "abc &# 60 def"


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|A useful technique for translating plain text to HTML is to replace | class="webkit-line-number"| | class="webkit-line-content"|each '<', '&', and '>' by an <A HREF="html-spec_2.html#GLOSS15" REL=GLOSSARY>entity</A> reference or numeric <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> | class="webkit-line-number"| | class="webkit-line-content"|reference as follows: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|ENTITY NUMERIC


| class="webkit-line-number"|
| class="webkit-line-content"|CHARACTER REFERENCE CHAR REF CHARACTER DESCRIPTION


| class="webkit-line-number"|
| class="webkit-line-content"|--------- ---------- ----------- ---------------------


| class="webkit-line-number"|
| class="webkit-line-content"|& &amp; &#38; Ampersand


| class="webkit-line-number"|
| class="webkit-line-content"|< &lt; &#60; Less than


| class="webkit-line-number"|
| class="webkit-line-content"|> &gt; &#62; Greater than


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|<A NAME="FOOT5" HREF="html-spec_foot.html#FOOT5" REL=FOOTNOTE>(5)</A> | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

<A NAME="SEC3.2.2" HREF="html-spec_toc.html#SEC3.2.2" REL=TOC>Tags</A>


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|Tags delimit elements such as headings, paragraphs, lists, <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> | class="webkit-line-number"| | class="webkit-line-content"|highlighting, and links. Most HTML elements are identified in a | class="webkit-line-number"| | class="webkit-line-content"|document as a <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>, which gives the <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> name and attributes, | class="webkit-line-number"| | class="webkit-line-content"|followed by the content, followed by the end <A HREF="html-spec_2.html#GLOSS32" REL=GLOSSARY>tag</A>. Start-tags are | class="webkit-line-number"| | class="webkit-line-content"|delimited by `<' and `>'; end tags are delimited by | class="webkit-line-number"| | class="webkit-line-content"|`</' and `>'. An example is: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<H1>This is a Heading</H1>


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|Some elements only have a <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A> without an <A HREF="html-spec_2.html#GLOSS14" REL=GLOSSARY>end-tag</A>. For example, | class="webkit-line-number"| | class="webkit-line-content"|to create a line break, use the `<BR>' <A HREF="html-spec_2.html#GLOSS32" REL=GLOSSARY>tag</A>. Additionally, | class="webkit-line-number"| | class="webkit-line-content"|the end tags of some other elements, such as Paragraph | class="webkit-line-number"| | class="webkit-line-content"|(`</P>'), List Item (`</LI>'), Definition Term | class="webkit-line-number"| | class="webkit-line-content"|(`</DT>'), and Definition Description (`</DD>') | class="webkit-line-number"| | class="webkit-line-content"|elements, <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> be omitted. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|The content of an <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> is a sequence of <A HREF="html-spec_2.html#GLOSS10" REL=GLOSSARY>data character</A> strings and nested | class="webkit-line-number"| | class="webkit-line-content"|elements. Some elements, such as anchors, cannot be nested. Anchors | class="webkit-line-number"| | class="webkit-line-content"|and <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> highlighting <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> be put inside other constructs. See | class="webkit-line-number"| | class="webkit-line-content"|the HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A>, section <A HREF="html-spec_9.html#SEC9.1" REL=XREF>HTML DTD</A> for full details. | class="webkit-line-number"| | class="webkit-line-content"|<A NAME="FOOT6" HREF="html-spec_foot.html#FOOT6" REL=FOOTNOTE>(6)</A> | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

<A NAME="SEC3.2.3" HREF="html-spec_toc.html#SEC3.2.3" REL=TOC>Names</A>


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|A name consists of a letter followed by letters, digits, periods, or | class="webkit-line-number"| | class="webkit-line-content"|hyphens. The length of a name is limited to 72 characters by the | class="webkit-line-number"| | class="webkit-line-content"|`NAMELEN' parameter in the SGML declaration for HTML, section <A HREF="html-spec_9.html#SEC9.5" REL=XREF>SGML Declaration for HTML</A>. <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>Element</A> and attribute names are not case sensitive, but | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS15" REL=GLOSSARY>entity</A> names are. For example, `<BLOCKQUOTE>', | class="webkit-line-number"| | class="webkit-line-content"|`<BlockQuote>', and `<blockquote>' are equivalent, | class="webkit-line-number"| | class="webkit-line-content"|whereas `&amp;' is different from `&AMP;'. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|In a <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>, the <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> name <A HREF="html-spec_2.html#GLOSS25" REL=GLOSSARY>must</A> immediately follow the <A HREF="html-spec_2.html#GLOSS32" REL=GLOSSARY>tag</A> | class="webkit-line-number"| | class="webkit-line-content"|open delimiter `<'. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

<A NAME="SEC3.2.4" HREF="html-spec_toc.html#SEC3.2.4" REL=TOC>Attributes</A>


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|In a <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>, white space and attributes are allowed between the | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> name and the closing delimiter. An attribute specification | class="webkit-line-number"| | class="webkit-line-content"|typically consists of an attribute name, an equal sign, and a value, | class="webkit-line-number"| | class="webkit-line-content"|though some attribute specifications <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> be just a name token. White | class="webkit-line-number"| | class="webkit-line-content"|space is allowed around the equal sign. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|The value of the attribute <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> be either: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|
    | class="webkit-line-number"| | class="webkit-line-content"|
  • | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|A string literal, delimited by single quotes or double quotes and | class="webkit-line-number"| | class="webkit-line-content"|not containing any occurrences of the delimiting <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A>. | class="webkit-line-number"| | class="webkit-line-content"|<A NAME="FOOT7" HREF="html-spec_foot.html#FOOT7" REL=FOOTNOTE>(7)</A> | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|
  • | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|A name token (a sequence of letters, digits, periods, or hyphens). | class="webkit-line-number"| | class="webkit-line-content"|Name tokens are not case sensitive. | class="webkit-line-number"| | class="webkit-line-content"|<A NAME="FOOT8" HREF="html-spec_foot.html#FOOT8" REL=FOOTNOTE>(8)</A> | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|In this example, img is the <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> name, src is the | class="webkit-line-number"| | class="webkit-line-content"|attribute name, and `http://host/dir/file.gif' is the | class="webkit-line-number"| | class="webkit-line-content"|attribute value: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<img src='http://host/dir/file.gif'>


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|A useful technique for computing an attribute value literal for a | class="webkit-line-number"| | class="webkit-line-content"|given string is to replace each quote and white space <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> by an | class="webkit-line-number"| | class="webkit-line-content"|<A HREF="html-spec_2.html#GLOSS15" REL=GLOSSARY>entity</A> reference or <A HREF="html-spec_2.html#GLOSS26" REL=GLOSSARY>numeric character reference</A> as follows: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|ENTITY NUMERIC


| class="webkit-line-number"|
| class="webkit-line-content"|CHARACTER REFERENCE CHAR REF CHARACTER DESCRIPTION


| class="webkit-line-number"|
| class="webkit-line-content"|--------- ---------- ----------- ---------------------


| class="webkit-line-number"|
| class="webkit-line-content"|HT &#9; Tab


| class="webkit-line-number"|
| class="webkit-line-content"|LF &#10; Line Feed


| class="webkit-line-number"|
| class="webkit-line-content"|CR &#13; Carriage Return


| class="webkit-line-number"|
| class="webkit-line-content"|SP &#32; Space


| class="webkit-line-number"|
| class="webkit-line-content"|" &quot; &#34; Quotation mark


| class="webkit-line-number"|
| class="webkit-line-content"|& &amp; &#38; Ampersand


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|For example: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<IMG SRC="image.jpg" alt="First &quot;real&quot; example">


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|The `NAMELEN' parameter in the SGML declaration (section <A HREF="html-spec_9.html#SEC9.5" REL=XREF>SGML Declaration for HTML</A>) limits the length of an attribute value to 1024 | class="webkit-line-number"| | class="webkit-line-content"|characters. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|Attributes such as ISMAP and COMPACT <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> be written using a minimized | class="webkit-line-number"| | class="webkit-line-content"|syntax (see 7.9.1.2 "Omitted Attribute Name" in <A HREF="html-spec_11.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>). The <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A>: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<UL COMPACT="compact">


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|can be written using a minimized syntax: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<UL COMPACT>


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|<A NAME="FOOT9" HREF="html-spec_foot.html#FOOT9" REL=FOOTNOTE>(9)</A> | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

<A NAME="SEC3.2.5" HREF="html-spec_toc.html#SEC3.2.5" REL=TOC>Comments</A>


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|To include comments in an <A HREF="html-spec_2.html#GLOSS18" REL=GLOSSARY>HTML document</A>, use a comment declaration. A | class="webkit-line-number"| | class="webkit-line-content"|comment declaration consists of `<!' followed by zero or more | class="webkit-line-number"| | class="webkit-line-content"|comments followed by `>'. Each comment starts with `--' and | class="webkit-line-number"| | class="webkit-line-content"|includes all text up to and including the next occurrence of | class="webkit-line-number"| | class="webkit-line-content"|`--'. In a comment declaration, white space is allowed after | class="webkit-line-number"| | class="webkit-line-content"|each comment, but not before the first comment. The entire comment | class="webkit-line-number"| | class="webkit-line-content"|declaration is ignored. | class="webkit-line-number"| | class="webkit-line-content"|<A NAME="FOOT10" HREF="html-spec_foot.html#FOOT10" REL=FOOTNOTE>(10)</A> | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|For example: | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN">


| class="webkit-line-number"|
| class="webkit-line-content"|<HEAD>


| class="webkit-line-number"|
| class="webkit-line-content"|<TITLE>HTML Comment Example</TITLE>


| class="webkit-line-number"|
| class="webkit-line-content"|<!-- Id: html-sgml.sgm,v 1.5 1995/05/26 21:29:50 connolly Exp -->


| class="webkit-line-number"|
| class="webkit-line-content"|<!-- another -- -- comment -->


| class="webkit-line-number"|
| class="webkit-line-content"|<!>


| class="webkit-line-number"|
| class="webkit-line-content"|</HEAD>


| class="webkit-line-number"|
| class="webkit-line-content"|<BODY>


| class="webkit-line-number"|
| class="webkit-line-content"|<p> <!- not a comment, just regular old data characters ->


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

<A NAME="SEC3.3" HREF="html-spec_toc.html#SEC3.3" REL=TOC>HTML Public Text Identifiers</A>


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|To identify information as an <A HREF="html-spec_2.html#GLOSS18" REL=GLOSSARY>HTML document</A> conforming to this | class="webkit-line-number"| | class="webkit-line-content"|specification, each document <A HREF="html-spec_2.html#GLOSS25" REL=GLOSSARY>must</A> start with one of the following | class="webkit-line-number"| | class="webkit-line-content"|document type declarations. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN">


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|This document type declaration refers to the HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> in section <A HREF="html-spec_9.html#SEC9.1" REL=XREF>HTML DTD</A>. | class="webkit-line-number"| | class="webkit-line-content"|<A NAME="FOOT11" HREF="html-spec_foot.html#FOOT11" REL=FOOTNOTE>(11)</A> | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Level 2//EN">


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|This document type declaration also refers to the HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> which | class="webkit-line-number"| | class="webkit-line-content"|appears in section <A HREF="html-spec_9.html#SEC9.1" REL=XREF>HTML DTD</A>. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Level 1//EN">


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|This document type declaration refers to the level 1 HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> in | class="webkit-line-number"| | class="webkit-line-content"|section <A HREF="html-spec_9.html#SEC9.3" REL=XREF>Level 1 HTML DTD</A>. Form elements <A HREF="html-spec_2.html#GLOSS25" REL=GLOSSARY>must</A> not occur in level 1 | class="webkit-line-number"| | class="webkit-line-content"|documents. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Strict//EN">


| class="webkit-line-number"|
| class="webkit-line-content"|<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Strict Level 1//EN">


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|These two document type declarations refer to the HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> in section <A HREF="html-spec_9.html#SEC9.2" REL=XREF>Strict HTML DTD</A> and section <A HREF="html-spec_9.html#SEC9.4" REL=XREF>Strict Level 1 HTML DTD</A>. They refer to the more | class="webkit-line-number"| | class="webkit-line-content"|structurally rigid definition of HTML. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

| class="webkit-line-number"| | class="webkit-line-content"|HTML user agents <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> support other document types. In particular, | class="webkit-line-number"| | class="webkit-line-content"|they <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> support other formal public identifiers, or other document | class="webkit-line-number"| | class="webkit-line-content"|types altogether. They <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> support an internal declaration subset with | class="webkit-line-number"| | class="webkit-line-content"|supplemental <A HREF="html-spec_2.html#GLOSS15" REL=GLOSSARY>entity</A>, <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A>, and other <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> declarations. | class="webkit-line-number"| | class="webkit-line-content"| | class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|

<A NAME="SEC3.4" HREF="html-spec_toc.html#SEC3.4" REL=TOC>Example HTML Document</A>


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"|
| class="webkit-line-content"|<!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN">


| class="webkit-line-number"|
| class="webkit-line-content"|<HTML>


| class="webkit-line-number"|
| class="webkit-line-content"|<!-- Here's a good place to put a comment. -->


| class="webkit-line-number"|
| class="webkit-line-content"|<HEAD>


| class="webkit-line-number"|
| class="webkit-line-content"|<TITLE>Structural Example</TITLE>


| class="webkit-line-number"|
| class="webkit-line-content"|</HEAD><BODY>


| class="webkit-line-number"|
| class="webkit-line-content"|<H1>First Header</H1>


| class="webkit-line-number"|
| class="webkit-line-content"|<P>This is a paragraph in the example HTML file. Keep in mind


| class="webkit-line-number"|
| class="webkit-line-content"|that the title does not appear in the document text, but that


| class="webkit-line-number"|
| class="webkit-line-content"|the header (defined by H1) does.</P>


| class="webkit-line-number"|
| class="webkit-line-content"|<OL>


| class="webkit-line-number"|
| class="webkit-line-content"|<LI>First item in an ordered list.


| class="webkit-line-number"|
| class="webkit-line-content"|<LI>Second item in an ordered list.


| class="webkit-line-number"|
| class="webkit-line-content"|<UL COMPACT>


| class="webkit-line-number"|
| class="webkit-line-content"|<LI> Note that lists can be nested;


| class="webkit-line-number"|
| class="webkit-line-content"|<LI> Whitespace <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> be used to assist in reading the


| class="webkit-line-number"|
| class="webkit-line-content"|HTML source.


| class="webkit-line-number"|
| class="webkit-line-content"|</UL>


| class="webkit-line-number"|
| class="webkit-line-content"|<LI>Third item in an ordered list.


| class="webkit-line-number"|
| class="webkit-line-content"|</OL>


| class="webkit-line-number"|
| class="webkit-line-content"|<P>This is an additional paragraph. Technically, end tags are


| class="webkit-line-number"|
| class="webkit-line-content"|not required for paragraphs, although they are allowed. You can


| class="webkit-line-number"|
| class="webkit-line-content"|include <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> highlighting in a paragraph. <EM>This sentence


| class="webkit-line-number"|
| class="webkit-line-content"|of the paragraph is emphasized.</EM> Note that the &lt;/P&gt;


| class="webkit-line-number"|
| class="webkit-line-content"|end <A HREF="html-spec_2.html#GLOSS32" REL=GLOSSARY>tag</A> has been omitted.


| class="webkit-line-number"|
| class="webkit-line-content"|<P>


| class="webkit-line-number"|
| class="webkit-line-content"|<IMG SRC ="triangle.xbm" alt="Warning: ">


| class="webkit-line-number"|
| class="webkit-line-content"|Be sure to read these <b>bold instructions</b>.


| class="webkit-line-number"|
| class="webkit-line-content"|</BODY></HTML>


| class="webkit-line-number"|
| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|


| class="webkit-line-number"|

| class="webkit-line-content"|


| class="webkit-line-number"| | class="webkit-line-content"|Go to the <A HREF="html-spec_1.html" REL=FIRST>first</A>, <A HREF="html-spec_2.html" REL=PREVIOUS>previous</A>, <A HREF="html-spec_4.html" REL=NEXT>next</A>, <A HREF="html-spec_14.html" REL=LAST>last</A> section, <A HREF="html-spec_toc.html" REL=TOC>table of contents</A>.


| class="webkit-line-number"| | class="webkit-line-content"|</BODY>


| class="webkit-line-number"| | class="webkit-line-content"|</HTML>

[[Category:<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//EN"><HTML> <HEAD> <TITLE>Hypertext Markup Language - 2.0 - HTML as an Application of SGML</TITLE> </HEAD> <BODY> Go to the <A HREF="html-spec_1.html" REL=FIRST>first</A>, <A HREF="html-spec_2.html" REL=PREVIOUS>previous</A>, <A HREF="html-spec_4.html" REL=NEXT>next</A>, <A HREF="html-spec_14.html" REL=LAST>last</A> section, <A HREF="html-spec_toc.html" REL=TOC>table of contents</A>.

<A NAME="SEC3" HREF="html-spec_toc.html#SEC3" REL=TOC>HTML as an Application of SGML</A>

HTML is an application of ISO 8879:1986 -- Standard Generalized <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>Markup</A> Language (SGML). SGML is a system for defining structured document types and <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> languages to represent instances of those document types<A HREF="html-spec_11.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>. The public text -- <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> and SGML declaration -- of the <A HREF="html-spec_2.html#GLOSS18" REL=GLOSSARY>HTML document</A> type definition are provided in section <A HREF="html-spec_9.html#SEC9" REL=XREF>HTML Public Text</A>.

The term HTML refers to both the document type defined here and the <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> language for representing instances of this document type.

<A NAME="SEC3.1" HREF="html-spec_toc.html#SEC3.1" REL=TOC>SGML Documents</A>

An <A HREF="html-spec_2.html#GLOSS18" REL=GLOSSARY>HTML document</A> is an <A HREF="html-spec_2.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.

In the SGML specification, the first production of the SGML syntax grammar separates an <A HREF="html-spec_2.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_2.html#GLOSS12" REL=GLOSSARY>DTD</A>. This <A HREF="html-spec_2.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_2.html#GLOSS13" REL=GLOSSARY>element</A> declarations. The instance <A HREF="html-spec_2.html#GLOSS25" REL=GLOSSARY>must</A> conform to the <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A>, that is, it <A HREF="html-spec_2.html#GLOSS25" REL=GLOSSARY>must</A> be in the language defined by this grammar.

The SGML declaration determines the lexicon of the grammar. It specifies the <A HREF="html-spec_2.html#GLOSS11" REL=GLOSSARY>document character set</A>, which determines a <A HREF="html-spec_2.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.

The SGML declaration also specifies the <A HREF="html-spec_2.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.

For example, consider the following document:

  <!DOCTYPE html PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN"> <title>Parsing Example</title> <p>Some text. <em>&#42;wow&#42;</em></p> 

An HTML <A HREF="html-spec_2.html#GLOSS36" REL=GLOSSARY>user agent</A> <A HREF="html-spec_2.html#GLOSS29" REL=GLOSSARY>should</A> use the SGML declaration that is given in section <A HREF="html-spec_9.html#SEC9.5" REL=XREF>SGML Declaration for HTML</A>. According to its <A HREF="html-spec_2.html#GLOSS11" REL=GLOSSARY>document character set</A>, `&#42;' refers to an asterisk <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A>, `*'.

The instance above is regarded as the following sequence of terminals:

  1. <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>: TITLE
  2. data characters: "Parsing Example"
  3. <A HREF="html-spec_2.html#GLOSS14" REL=GLOSSARY>end-tag</A>: TITLE
  4. <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>: P
  5. data characters "Some text. "
  6. <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>: EM
  7. data characters: "*wow*"
  8. <A HREF="html-spec_2.html#GLOSS14" REL=GLOSSARY>end-tag</A>: EM
  9. <A HREF="html-spec_2.html#GLOSS14" REL=GLOSSARY>end-tag</A>: P

The start symbol of the <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> grammar is HTML, and the productions are given in the public text identified by `-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN' (section <A HREF="html-spec_9.html#SEC9.1" REL=XREF>HTML DTD</A>). The terminals above parse as:

     HTML     |     \-HEAD     |  |     |  \-TITLE     |      |     |      \-<TITLE>     |      |     |      \-"Parsing Example"     |      |     |      \-</TITLE>     |     \-BODY       |       \-P         |         \-<P>         |         \-"Some text. "         |         \-EM         |  |         |  \-<EM>         |  |         |  \-"*wow*"         |  |         |  \-</EM>         |          \-</P> 

Some of the elements are delimited explicitly by tags, while the boundaries of others are inferred. The HTML <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> contains a HEAD <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> and a BODY <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A>. The HEAD contains TITLE, which is explicitly delimited by start- and end-tags.

<A NAME="SEC3.2" HREF="html-spec_toc.html#SEC3.2" REL=TOC>HTML Lexical Syntax</A>

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_2.html#GLOSS20" REL=GLOSSARY>markup</A> characters are in the repertoire of <A HREF="html-spec_11.html#BIB11" REL=BIBLIOGRAPHY>[ISO-646]</A>. Data characters are drawn from the document <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> set (see section <A HREF="html-spec_6.html#SEC6" REL=XREF>Characters, Words, and Paragraphs</A>).

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_11.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>. This section is only a summary.

<A NAME="SEC3.2.1" HREF="html-spec_toc.html#SEC3.2.1" REL=TOC>Data Characters</A>

Any sequence of characters that do not constitute <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> (see 9.6 "Delimiter Recognition" of <A HREF="html-spec_11.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>) are mapped directly to strings of data characters. Some <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> also maps to <A HREF="html-spec_2.html#GLOSS10" REL=GLOSSARY>data character</A> strings. Numeric character references map to single-<A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> strings, via the <A HREF="html-spec_2.html#GLOSS11" REL=GLOSSARY>document character set</A>. Each reference to one of the general entities defined in the HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> maps to a single-<A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> string.

For example,

  abc&lt;def    => "abc","<","def" abc&#60;def   => "abc","<","def" 

The terminating semicolon on <A HREF="html-spec_2.html#GLOSS15" REL=GLOSSARY>entity</A> or numeric character references is only necessary when the <A HREF="html-spec_2.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_11.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>).

  abc &lt def     => "abc ","<"," def" abc &#60 def    => "abc ","<"," def" 

An ampersand is only recognized as <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> when it is followed by a letter or a `#' and a digit:

  abc & lt def    => "abc & lt def" abc &# 60 def    => "abc &# 60 def" 

A useful technique for translating plain text to HTML is to replace each '<', '&', and '>' by an <A HREF="html-spec_2.html#GLOSS15" REL=GLOSSARY>entity</A> reference or numeric <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> reference as follows:

                   ENTITY      NUMERIC        CHARACTER REFERENCE   CHAR REF     CHARACTER DESCRIPTION        --------- ----------  -----------  ---------------------          &       &amp;       &#38;        Ampersand           <       &lt;        &#60;        Less than          >       &gt;        &#62;        Greater than 

<A NAME="FOOT5" HREF="html-spec_foot.html#FOOT5" REL=FOOTNOTE>(5)</A>

<A NAME="SEC3.2.2" HREF="html-spec_toc.html#SEC3.2.2" REL=TOC>Tags</A>

Tags delimit elements such as headings, paragraphs, lists, <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A> highlighting, and links. Most HTML elements are identified in a document as a <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>, which gives the <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> name and attributes, followed by the content, followed by the end <A HREF="html-spec_2.html#GLOSS32" REL=GLOSSARY>tag</A>. Start-tags are delimited by `<' and `>'; end tags are delimited by `</' and `>'. An example is:

  <H1>This is a Heading</H1> 

Some elements only have a <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A> without an <A HREF="html-spec_2.html#GLOSS14" REL=GLOSSARY>end-tag</A>. For example, to create a line break, use the `<BR>' <A HREF="html-spec_2.html#GLOSS32" REL=GLOSSARY>tag</A>. Additionally, the end tags of some other elements, such as Paragraph (`</P>'), List Item (`</LI>'), Definition Term (`</DT>'), and Definition Description (`</DD>') elements, <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> be omitted.

The content of an <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> is a sequence of <A HREF="html-spec_2.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_2.html#GLOSS4" REL=GLOSSARY>character</A> highlighting <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> be put inside other constructs. See the HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A>, section <A HREF="html-spec_9.html#SEC9.1" REL=XREF>HTML DTD</A> for full details. <A NAME="FOOT6" HREF="html-spec_foot.html#FOOT6" REL=FOOTNOTE>(6)</A>

<A NAME="SEC3.2.3" HREF="html-spec_toc.html#SEC3.2.3" REL=TOC>Names</A>

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 `NAMELEN' parameter in the SGML declaration for HTML, section <A HREF="html-spec_9.html#SEC9.5" REL=XREF>SGML Declaration for HTML</A>. <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>Element</A> and attribute names are not case sensitive, but <A HREF="html-spec_2.html#GLOSS15" REL=GLOSSARY>entity</A> names are. For example, `<BLOCKQUOTE>', `<BlockQuote>', and `<blockquote>' are equivalent, whereas `&amp;' is different from `&AMP;'.

In a <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>, the <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> name <A HREF="html-spec_2.html#GLOSS25" REL=GLOSSARY>must</A> immediately follow the <A HREF="html-spec_2.html#GLOSS32" REL=GLOSSARY>tag</A> open delimiter `<'.

<A NAME="SEC3.2.4" HREF="html-spec_toc.html#SEC3.2.4" REL=TOC>Attributes</A>

In a <A HREF="html-spec_2.html#GLOSS30" REL=GLOSSARY>start-tag</A>, white space and attributes are allowed between the <A HREF="html-spec_2.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_2.html#GLOSS21" REL=GLOSSARY>may</A> be just a name token. White space is allowed around the equal sign.

The value of the attribute <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> be either:

  • A string literal, delimited by single quotes or double quotes and not containing any occurrences of the delimiting <A HREF="html-spec_2.html#GLOSS4" REL=GLOSSARY>character</A>. <A NAME="FOOT7" HREF="html-spec_foot.html#FOOT7" REL=FOOTNOTE>(7)</A>
  • 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>

In this example, img is the <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A> name, src is the attribute name, and `http://host/dir/file.gif' is the attribute value:

  <img src='http://host/dir/file.gif'> 

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_2.html#GLOSS4" REL=GLOSSARY>character</A> by an <A HREF="html-spec_2.html#GLOSS15" REL=GLOSSARY>entity</A> reference or <A HREF="html-spec_2.html#GLOSS26" REL=GLOSSARY>numeric character reference</A> as follows:

                   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  

For example:

  <IMG SRC="image.jpg" alt="First &quot;real&quot; example"> 

The `NAMELEN' parameter in the SGML declaration (section <A HREF="html-spec_9.html#SEC9.5" REL=XREF>SGML Declaration for HTML</A>) limits the length of an attribute value to 1024 characters.

Attributes such as ISMAP and COMPACT <A HREF="html-spec_2.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_11.html#BIB14" REL=BIBLIOGRAPHY>[SGML]</A>). The <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A>:

  <UL COMPACT="compact"> 

can be written using a minimized syntax:

  <UL COMPACT> 

<A NAME="FOOT9" HREF="html-spec_foot.html#FOOT9" REL=FOOTNOTE>(9)</A>

<A NAME="SEC3.2.5" HREF="html-spec_toc.html#SEC3.2.5" REL=TOC>Comments</A>

To include comments in an <A HREF="html-spec_2.html#GLOSS18" REL=GLOSSARY>HTML document</A>, use a comment declaration. A comment declaration consists of `<!' followed by zero or more comments followed by `>'. Each comment starts with `--' and includes all text up to and including the next occurrence of `--'. 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>

For example:

  <!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.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 -> 

<A NAME="SEC3.3" HREF="html-spec_toc.html#SEC3.3" REL=TOC>HTML Public Text Identifiers</A>

To identify information as an <A HREF="html-spec_2.html#GLOSS18" REL=GLOSSARY>HTML document</A> conforming to this specification, each document <A HREF="html-spec_2.html#GLOSS25" REL=GLOSSARY>must</A> start with one of the following document type declarations.

  <!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0//EN"> 

This document type declaration refers to the HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> in section <A HREF="html-spec_9.html#SEC9.1" REL=XREF>HTML DTD</A>. <A NAME="FOOT11" HREF="html-spec_foot.html#FOOT11" REL=FOOTNOTE>(11)</A>

  <!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Level 2//EN"> 

This document type declaration also refers to the HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> which appears in section <A HREF="html-spec_9.html#SEC9.1" REL=XREF>HTML DTD</A>.

  <!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Level 1//EN"> 

This document type declaration refers to the level 1 HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> in section <A HREF="html-spec_9.html#SEC9.3" REL=XREF>Level 1 HTML DTD</A>. Form elements <A HREF="html-spec_2.html#GLOSS25" REL=GLOSSARY>must</A> not occur in level 1 documents.

  <!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Strict//EN"> <!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> HTML 2.0 Strict Level 1//EN"> 

These two document type declarations refer to the HTML <A HREF="html-spec_2.html#GLOSS12" REL=GLOSSARY>DTD</A> in section <A HREF="html-spec_9.html#SEC9.2" REL=XREF>Strict HTML DTD</A> and section <A HREF="html-spec_9.html#SEC9.4" REL=XREF>Strict Level 1 HTML DTD</A>. They refer to the more structurally rigid definition of HTML.

HTML user agents <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> support other document types. In particular, they <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> support other formal public identifiers, or other document types altogether. They <A HREF="html-spec_2.html#GLOSS21" REL=GLOSSARY>may</A> support an internal declaration subset with supplemental <A HREF="html-spec_2.html#GLOSS15" REL=GLOSSARY>entity</A>, <A HREF="html-spec_2.html#GLOSS13" REL=GLOSSARY>element</A>, and other <A HREF="html-spec_2.html#GLOSS20" REL=GLOSSARY>markup</A> declarations.

<A NAME="SEC3.4" HREF="html-spec_toc.html#SEC3.4" REL=TOC>Example HTML Document</A>

  <!DOCTYPE HTML PUBLIC "-//IETF//<A HREF="html-spec_2.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_2.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_2.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_2.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> 

Go to the <A HREF="html-spec_1.html" REL=FIRST>first</A>, <A HREF="html-spec_2.html" REL=PREVIOUS>previous</A>, <A HREF="html-spec_4.html" REL=NEXT>next</A>, <A HREF="html-spec_14.html" REL=LAST>last</A> section, <A HREF="html-spec_toc.html" REL=TOC>table of contents</A>. </BODY> </HTML> ]]