<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/styles/XMLStylesDoc_xhtml10_en.xsl"?><!DOCTYPE document SYSTEM "/schemas/XMLStyles10.dtd">
<document xmlns="http://XMLStyles.com/namespaces/styles" xmlns:xst="http://XMLStyles.com/namespaces/styles" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:date="http://exslt.org/dates-and-times">
   <noxml>
      <p xmlns="http://www.w3.org/1999/xhtml"/>
      <!-- You are viewing the source.  The following message should be ignored if you did "View Source" in your browser. -->
      <p xmlns="http://www.w3.org/1999/xhtml">
ATTENTION: XML WEB PAGES NOT SUPPORTED
   If you see this message, your current browser does not support the
   1999 XSLT 1.0 (or later) standard for XML web pages such as this one.
   Please upgrade your browser to a newer version
   that supports 1999 or later standards such as:
      Mozilla Firefox version 1.0.2 or later (GetFirefox -&gt; http://www.GetFirefox.com/)
      Netscape version 8 or later
      Safari version 1.3 or later
      Opera version 9 or later
      Microsoft Internet Explorer (MSIE) version 5 or later
   For further assistance, contact the software vendor for your browser.
   To go to the X<!-- extended HTML -->HTML version of this page click the following link:
<a href="index.html">index.html</a>
      </p>
      <p xmlns="http://www.w3.org/1999/xhtml">&#160;</p>
   </noxml>
   <path>/tags/doctype-declaration/</path>
   <site>HTML 5 Reference</site>
   <logo xlink:type="simple" xlink:href="/images/html-5.jpg" media="screen" width="156" height="27">HTML 5 Reference</logo>
   <logo xlink:type="simple" xlink:href="/images/html-5.jpg" media="print" width="156" height="27">HTML 5 Reference</logo>
   <logo xlink:type="simple" xlink:href="/images/html-5.jpg" media="handheld" width="150" height="17">HTML 5 Reference</logo>
   <navigation where="sections">
      <label>HTML 5 Reference</label>
      <link xlink:type="simple" xlink:href="/index.xml">Home</link>
      <link xlink:type="simple" xlink:href="/tutorial/index.xml">Tutorial</link>
      <link xlink:type="simple" xlink:href="/tags/index.xml">HTML5 Tags</link>
      <link xlink:type="simple" xlink:href="/attributes/index.xml">Attributes</link>
      <link xlink:type="simple" xlink:href="/css-styles/index.xml">CSS Styles</link>
      <link xlink:type="simple" xlink:href="/metatags/index.xml">Metatags</link>
      <link xlink:type="simple" xlink:href="/cheat-sheet/index.xml">Cheat Sheet</link>
      <link xlink:type="simple" xlink:href="/examples/index.xml">Examples</link>
      <link xlink:type="simple" xlink:href="/definitions/index.xml">Definitions</link>
      <link xlink:type="simple" xlink:href="/diffs/index.xml">Differences</link>
      <link xlink:type="simple" xlink:href="/avoid/index.xml">Avoid</link>
      <link xlink:type="simple" xlink:href="/faqs/index.xml">HTML5 FAQs</link>
      <link xlink:type="simple" xlink:href="/prod/rssfeeds.cgi">RSS Feeds</link>
      <link xlink:type="simple" xlink:href="/prod/help/index.cgi">Help</link>
   </navigation>
   <navigation where="left">
      <label>HTML 5 Reference</label>
      <link xlink:type="simple" xlink:href="/tutorial/index.xml">HTML Tutorial</link>
      <link xlink:type="simple" xlink:href="/tags/index.xml">HTML 5 Tags</link>
      <link xlink:type="simple" xlink:href="/attributes/index.xml">HTML Attributes</link>
      <link xlink:type="simple" xlink:href="/css-styles/index.xml">CSS Styles</link>
      <link xlink:type="simple" xlink:href="/metatags/index.xml">HTML Metatags</link>
      <link xlink:type="simple" xlink:href="/cheat-sheet/index.xml">Cheat Sheet</link>
      <link xlink:type="simple" xlink:href="/examples/index.xml">HTML Examples</link>
      <link xlink:type="simple" xlink:href="/definitions/index.xml">Definitions</link>
      <link xlink:type="simple" xlink:href="/diffs/index.xml">HTML 5 Changes</link>
      <link xlink:type="simple" xlink:href="/avoid/index.xml">Things to Avoid</link>
      <link xlink:type="simple" xlink:href="/faqs/index.xml">HTML 5 FAQs</link>
      <link xlink:type="simple" xlink:href="/prod/help/index.cgi">Help</link>
      <link xlink:type="simple" xlink:href="/prod/help/index.cgi?p=about">About</link>
   </navigation>
   <section type="body">
      <pages name="index">
         <navigation media="handheld" where="up">
            <link xlink:type="simple" xlink:href="../index.mobile.html">HTML Tags</link>
         </navigation>
         <navigation media="handheld" where="next">
            <link xlink:type="simple" xlink:href="../dt-tag/index.mobile.html">The &lt;dt&gt; Tag</link>
         </navigation>
         <page id="N100AC" name="index">
            <label>DOCTYPE</label>
            <title>DOCTYPE Declaration</title>
            <h2>The DOCTYPE Declaration</h2>
            <subpage id="N100B4" name="reference">
               <h3>The <code>DOCTYPE</code> declaration in HTML 5</h3>
               <p>The <code>DOCTYPE</code> declaration indicates that the content is
                  a <acronym term="Hypertext Markup Language">HTML</acronym> document.
                  The name parameter of the DOCTYPE declaration must be <code>html</code>,
                  matching the name of the top element an HTML document.
               </p>
               <h3>Converting to HTML 5</h3>
               <p>We are working on <link xlink:type="simple" xlink:href="../../tutorials/converting-to-html-5.html">converting to HTML 5</link>.
               Please visit <link xlink:type="simple" xlink:href="../doctype-declaration/index.html">HTML DOCTYPE Declaration</link> on the
               <link xlink:type="simple" xlink:href="http://www.HTML-5.com/index.html">HTML 5 standard</link> version of this site.
            </p>
               <h4>HTML Best Practices - Why specify a doctype?</h4>
               <p>From the W3C <i>Tips for Webmasters</i>:
               </p>
               <blockquote>Why specify a DOCTYPE? Because it defines which version of
                  (X)HTML your document is actually using, and this is a critical piece of
                  information needed by browsers or other tools processing the document.
               </blockquote>
               <p>Since the document type is needed by web browsers, viewers or other tools
                  in order to properly interpret a document as a particular version of HTML,
                  the information provided by the DOCTYPE is especially important in situations
                  where there are no HTTP headers available or when the headers do not indicate an
                  XHTML/XML media type such as <span class="outlined">application/xhtml+xml</span>.
                  Therefore, the DOCTYPE declaration is an important element when creating
                  <link xlink:type="simple" xlink:href="../../definitions/#polyglot">polyglot HTML documents</link>.
               </p>
            </subpage>
            <subpage id="N100EE" name="syntax">
               <label>Syntax</label>
               <title>&lt;!DOCTYPE&gt; Declaration Syntax</title>
               <h3>Syntax of the <code>DOCTYPE</code> declaration for HTML 5</h3>
               <blockcode>
                  <l>&lt;!DOCTYPE html&gt;</l>
               </blockcode>
               <p>
                  <code>&lt;!</code> indicates that this is an
                  <acronym term="Standard Generalized Markup Language">SGML</acronym> declaration,
                  <code>DOCTYPE</code> indicates the type of declaration is for the document type,
                  <code>html</code> is the tag name of the top element of the document
                  and <code>&gt;</code> ends the declaration.
               </p>
            </subpage>
            <subpage id="N1010D" name="attributes">
               <label>Attributes</label>
               <title>Attributes of the DOCTYPE Declaration</title>
               <h3>Attributes of the <code>DOCTYPE</code> Declaration</h3>
               <dl>
                  <di>
                     <dt>
                        <code/> attribute</dt>
                     <dd>The <code/> attribute
                     </dd>
                  </di>
               </dl>
            </subpage>
            <subpage id="examples" name="examples">
               <label>Examples</label>
               <title>HTML 5 Examples</title>
               <h3>Examples of the <code>DOCTYPE</code> declaration in HTML 5</h3>
               <h4>DOCTYPE with no additional entity declarations</h4>
               <p/>
               <blockcode>
                  <l class="output">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</l>
                  <l class="output">&lt;?xml-stylesheet type="text/xsl" href="/site-template.xsl"?&gt;</l>
                  <l>&lt;!DOCTYPE html&gt;</l>
                  <l class="output">&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;</l>
                  <l class="output">   ...</l>
                  <l class="output">&lt;/html&gt;</l>
               </blockcode>
               <h4>DOCTYPE with entities defined in an internal subset</h4>
               <p/>
               <blockcode>
                  <l class="output">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</l>
                  <l class="output">&lt;?xml-stylesheet type="text/xsl" href="/site-template.xsl"?&gt;</l>
                  <l>&lt;!DOCTYPE html [</l>
                  <l>     &lt;!ENTITY nbsp "&amp;#160;"&gt;</l>
                  <l>]&gt;</l>
                  <l class="output">&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;</l>
                  <l class="output">   ...</l>
                  <l class="output">&lt;/html&gt;</l>
               </blockcode>
               <p>If the HTML is being produced by software that does not allow the DTD to
                  be omitted, the URI <code>about:legacy-compat</code> may be specified:
               </p>
               <blockcode>
                  <l class="output">&lt;!DOCTYPE html SYSTEM "about:legacy-compat"&gt;</l>
               </blockcode>
            </subpage>
            <subpage id="differences" name="differences">
               <label>Differences</label>
               <title>Changes in HTML 5</title>
               <h3>What's new in HTML 5</h3>
               <p>There is no <acronym term="Document Type Definition">DTD</acronym> for HTML 5.
                  Therefore, the DOCTYPE declaration should not contain a <code>PUBLIC</code>
                  <acronym term="Formal Public Identifier">FPI</acronym> or <code>SYSTEM</code>
                  identifier. If the <code>SYSTEM</code> identifier is specified,
                  the value should always be <code>about:legacy-compat</code>.
               </p>
               <h3>Differences between HTML 5 and earlier versions</h3>
               <p>The <code>DOCTYPE</code> declaration was introduced for validation of
                  <acronym term="Standard Generalized Markup Language">SGML</acronym> documents
                  and carried over to HTML, which uses markup tags similar to SGML.
                  In SGML, XML and earlier versions of HTML, the DOCTYPE declaration points
                  to a <acronym term="Document Type Definition">DTD</acronym>,
                  which describes the syntax that the markup language adheres to.
                  Web browsers, which internally implement a rendering engine specific to HTML rather
                  than relying on an external DTD, have used the document type declaration simply to
                  determine how close to a supposedly <b>standard</b> version of HTML is being used.
                  For that reason, the references to the DTD have been dropped from the
                  <code>DOCTYPE</code>, but it is still included to indicate the HTML version.
               </p>
               <p>A few legacy values in the <code>DOCTYPE</code> declaration are
                  <i>permitted, but obsolete</i>.  The <code>PUBLIC</code> and
                  SYSTEM DTD identifiers should be removed from these declarations:
               </p>
               <blockcode>
                  <l>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"&gt;</l>
                  <l>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;</l>
                  <l>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;</l>
                  <l>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;</l>
               </blockcode>
               <p>HTML pages with these DOCTYPEs may be interpreted as either one of
                  the older (1997, 1999, 2000 or 2001, respectively) versions of HTML
                  or as HTML 5, depending on the browser implementation.
                  Once the <code>PUBLIC</code>, <acronym term="Formal Public Identifier">FPI</acronym>
                  and DTD identifier have been removed,
                  the pages should only be interpreted as HTML 5 documents.
               </p>
            </subpage>
            <updated local="2010-09-19">Sunday September 19, 2010</updated>
         </page>
      </pages>
   </section>
   <copyright>Copyright © 2010 Accilent<span class="sup">®</span> Corp. Alteration of content, including addition of any function such as hypertext links or pop-up advertising, or interference with the hypertext links or other functions of this site is expressly prohibited.</copyright>
   <disclaimer>All information, links, forms, applications and other items on this site or obtained from it are provided <b>AS IS</b>, WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.</disclaimer>
</document>

