| 34 |
|
|
| 35 |
<div class="section tokenize-error" id="bare-ero"><h3>The <code>&</code> character must |
<div class="section tokenize-error" id="bare-ero"><h3>The <code>&</code> character must |
| 36 |
introduce a reference.</h3> |
introduce a reference.</h3> |
| 37 |
<p>An <code>&</code> (<code>U+0026</code> |
<p>An <code>&</code> character which |
|
<code class="charname">AMPERSAND</code>) character which |
|
| 38 |
is not part of any reference appears in the input stream. |
is not part of any reference appears in the input stream. |
| 39 |
The document is non-conforming.</p> |
The document is non‐conforming.</p> |
| 40 |
|
|
| 41 |
<p><strong>Any <code>&</code> character in URI (or IRI) |
<p><em>Any <code>&</code> character in URI (or IRI) |
| 42 |
must be escaped as <code>&amp;</code>.</strong></p> |
must be escaped as <code class="example">&amp;</code>.</em></p> |
| 43 |
|
|
| 44 |
<p>The <code>&</code> character must |
<p>The <code>&</code> character must |
| 45 |
be the first character of a reference: |
be the first character of a reference: |
| 46 |
<dl> |
<dl class="switch"> |
| 47 |
<dt>Named entity reference</dt> |
<dt>Named entity reference</dt> |
| 48 |
<dd><pre class="html example"> |
<dd><pre class="html example"> |
| 49 |
<code>&<var>entity-name</var>;</code></pre> |
<code>&<var>entity-name</var>;</code></pre> |
| 113 |
|
|
| 114 |
<p>The string <code>&#</code> must be the first two characters |
<p>The string <code>&#</code> must be the first two characters |
| 115 |
of a reference: |
of a reference: |
| 116 |
<dl> |
<dl class="switch"> |
| 117 |
<dt>Numeric character reference</dt> |
<dt>Numeric character reference</dt> |
| 118 |
<dd><pre class="html example"> |
<dd><pre class="html example"> |
| 119 |
<code>&#<var>d</var>;</code></pre> |
<code>&#<var>d</var>;</code></pre> |
| 165 |
|
|
| 166 |
<dl class="switch"> |
<dl class="switch"> |
| 167 |
<dt>Comments</dt> |
<dt>Comments</dt> |
| 168 |
<dd>In HTML documents, comments must be introduced by |
<dd>In HTML document, comments must be introduced by |
| 169 |
<code><!--</code> (<code><!</code> <em>immediately</em> followed |
<code class="example"><!--</code> (<code><!</code> |
| 170 |
|
<em>immediately</em> followed |
| 171 |
by <em>two</em> <code>-</code>s) and must be terminated by |
by <em>two</em> <code>-</code>s) and must be terminated by |
| 172 |
<code>--></code>. Strings <code><!</code> not followed |
<code class="example">--></code>. |
| 173 |
|
Strings <code><!</code> not followed |
| 174 |
by <code>--</code> and <code><!-</code> not followed by |
by <code>--</code> and <code><!-</code> not followed by |
| 175 |
<code>-</code> are not valid open delimiters for comments.</dd> |
<code>-</code> are not valid open delimiters for comments.</dd> |
| 176 |
<dt>Marked sections, including <code>CDATA</code> sections</dt> |
<dt>Marked sections, including <code>CDATA</code> sections</dt> |
| 177 |
<dd>Marked sections are not allowed in HTML documents.</dd> |
<dd>Marked sections are not allowed in HTML document.</dd> |
| 178 |
<dt>Markup declarations</dt> |
<dt>Markup declarations</dt> |
| 179 |
<dd>Markup declarations, except <code>DOCTYPE</code> |
<dd>Markup declarations, except for <code>DOCTYPE</code> |
| 180 |
and comment declarations, are not allowed in HTML documents.</dd> |
and comment declarations, are not allowed in HTML document.</dd> |
| 181 |
<dt>String <code><!</code></dt> |
<dt>String <code><!</code></dt> |
| 182 |
<dd>String <code><!</code> must be escaped as |
<dd>String <code><!</code> must be escaped as |
| 183 |
<code>&lt;!</code>.</dd> |
<code class="example">&lt;!</code>.</dd> |
| 184 |
</dl> |
</dl> |
| 185 |
</div> |
</div> |
| 186 |
|
|
| 240 |
<dt><code><script/></code></dt> |
<dt><code><script/></code></dt> |
| 241 |
<dd><p>The polytheistic slash cannot be used for <code>script</code> |
<dd><p>The polytheistic slash cannot be used for <code>script</code> |
| 242 |
element. Even for an empty <code>script</code> element, |
element. Even for an empty <code>script</code> element, |
| 243 |
there must be an explicit end tag <code></script></code>.</p> |
there must be an explicit end tag |
| 244 |
|
<code class="html example"></script></code>.</p> |
| 245 |
|
|
| 246 |
<p><strong>NOTE</strong>: Though some user agents interpret |
<p><strong>NOTE</strong>: Though some user agents interpret |
| 247 |
polytheistic slash for <code>script</code> element as the |
polytheistic slash for <code>script</code> element as the |
| 258 |
to allow polytheistic slash for these elements.</dd> |
to allow polytheistic slash for these elements.</dd> |
| 259 |
<dt><code><a/></code>, <code><p/></code></dt> |
<dt><code><a/></code>, <code><p/></code></dt> |
| 260 |
<dd>These elements are not always empty and therefore |
<dd>These elements are not always empty and therefore |
| 261 |
polytheistic slash is not allowed.</dd> |
polytheistic slash is not allowed. Use explicit end tag |
| 262 |
|
to represent empty element as: |
| 263 |
|
<pre class="example html"> |
| 264 |
|
<code><p></p></code></pre> |
| 265 |
|
</dd> |
| 266 |
</dl> |
</dl> |
| 267 |
|
|
| 268 |
<p>Note that, unlike in XML, the polytheistic slash has |
<p>Note that, unlike in XML, the polytheistic slash has |
| 283 |
<dd>An <abbr>XBL</abbr> binding cannot be associated by |
<dd>An <abbr>XBL</abbr> binding cannot be associated by |
| 284 |
<abbr title="processing instruction">PI</abbr> in <abbr>HTML</abbr> |
<abbr title="processing instruction">PI</abbr> in <abbr>HTML</abbr> |
| 285 |
document. Use <code>binding</code> property in <abbr>CSS</abbr> |
document. Use <code>binding</code> property in <abbr>CSS</abbr> |
| 286 |
style sheet.</dd> |
style sheet as: |
| 287 |
|
<pre class="html example"> |
| 288 |
|
<code><style> |
| 289 |
|
p { |
| 290 |
|
binding: url(binding.xbl); |
| 291 |
|
} |
| 292 |
|
</style></code></pre> |
| 293 |
|
</dd> |
| 294 |
<dt><code><?xml?></code> (XML declaration)</dt> |
<dt><code><?xml?></code> (XML declaration)</dt> |
| 295 |
<dd>XML declaration is unnecessary for HTML documents.</dd> |
<dd>XML declaration is unnecessary for HTML documents.</dd> |
| 296 |
<dt><code><?xml-stylesheet?></code> (XML style sheet |
<dt><code><?xml-stylesheet?></code> (XML style sheet |
| 298 |
<dd>Use HTML <code>link</code> element with <code>rel</code> |
<dd>Use HTML <code>link</code> element with <code>rel</code> |
| 299 |
attribute set to <code>stylesheet</code> (or, |
attribute set to <code>stylesheet</code> (or, |
| 300 |
<code>alternate stylesheet</code> for an alternate style |
<code>alternate stylesheet</code> for an alternate style |
| 301 |
sheet).</dd> |
sheet). |
| 302 |
|
<pre class="example html"> |
| 303 |
|
<code><link rel=stylesheet href="path/to/stylesheet.css"></code></pre> |
| 304 |
|
</dd> |
| 305 |
<dt><code><?php?></code> or |
<dt><code><?php?></code> or |
| 306 |
<code><? <var>... <abbr>PHP</abbr> code ...</var> ?></code> |
<code><? <var>... <abbr>PHP</abbr> code ...</var> ?></code> |
| 307 |
(<abbr>PHP</abbr> code)</dt> |
(<abbr>PHP</abbr> code)</dt> |
| 441 |
<dd>Though the element is void in earlier versions of Safari, |
<dd>Though the element is void in earlier versions of Safari, |
| 442 |
the <code>canvas</code> element is <em>no</em> longer |
the <code>canvas</code> element is <em>no</em> longer |
| 443 |
defined as empty. There must be an end tag |
defined as empty. There must be an end tag |
| 444 |
<code></canvas></code>.</dd> |
<code class="html example"></canvas></code>.</dd> |
| 445 |
</dl> |
</dl> |
| 446 |
|
|
| 447 |
<p>Note that misnesting tags, such as |
<p>Note that misnesting tags, such as |
| 467 |
HTML.</h3> |
HTML.</h3> |
| 468 |
<p>The document contains a <code>DOCTYPE</code> declaration |
<p>The document contains a <code>DOCTYPE</code> declaration |
| 469 |
that is different from HTML5 <code>DOCTYPE</code> (i.e. |
that is different from HTML5 <code>DOCTYPE</code> (i.e. |
| 470 |
<code><!DOCTYPE HTML></code>). The document is non-conforming.</p> |
<code class="example html"><!DOCTYPE HTML></code>). |
| 471 |
|
The document is non‐conforming.</p> |
| 472 |
|
|
| 473 |
<p>The document might or might not be conformant to |
<p>The document might or might not be conformant to |
| 474 |
some version of HTML. However, conformance to any HTML |
some version of HTML. However, conformance to any HTML |
| 580 |
block-level content, any inline-level content must be |
block-level content, any inline-level content must be |
| 581 |
put in e.g. paragraph element such as <code>p</code>.</p> |
put in e.g. paragraph element such as <code>p</code>.</p> |
| 582 |
<p>For example, an HTML document fragment |
<p>For example, an HTML document fragment |
| 583 |
<code class="bad example"><div><p>Hello!</p> World!</div></code> |
<code class="html bad example"><div><p>Hello!</p> World!</div></code> |
| 584 |
is non-conforming, since a word <q>World!</q> does not belong |
is non-conforming, since a word <q>World!</q> does not belong |
| 585 |
to any paragraph. (If not part of any paragraph, what is |
to any paragraph. (If not part of any paragraph, what is |
| 586 |
it!?) A conforming example would be: |
it!?) A conforming example would be: |
| 587 |
<pre class="example"> |
<pre class="html example"> |
| 588 |
<code><div><p>Hello!</p> <p>World!</p></div></code></pre> |
<code><div><p>Hello!</p> <p>World!</p></div></code></pre> |
| 589 |
</p></dd> |
</p></dd> |
| 590 |
<dt>If the parent element does <em>not</em> allow |
<dt>If the parent element does <em>not</em> allow |
| 625 |
|
|
| 626 |
<dl class="switch"> |
<dl class="switch"> |
| 627 |
<dt><code>html</code> element in an XHTML document</dt> |
<dt><code>html</code> element in an XHTML document</dt> |
| 628 |
<dd><p>In an XHTML document, the root <code>html</code> |
<dd><p>In <abbr>XHTML</abbr> document, the root <code>html</code> |
| 629 |
element must have an <code>xmlns</code> attribute |
element must have an <code>xmlns</code> attribute as: |
| 630 |
whose value is set to |
<pre class="xml example"> |
| 631 |
<code>http://www.w3.org/1999/xhtml</code>.</p></dd> |
<code><html xmlns="http://www.w3.org/1999/xhtml"></code></pre></p></dd> |
| 632 |
<dt><code>rss</code> element</dt> |
<dt><code>rss</code> element</dt> |
| 633 |
<dd><p>The document is written in some version of RSS.</p> |
<dd><p>The document is written in some version of RSS.</p> |
| 634 |
<p>The conformance checker does not support any version |
<p>The conformance checker does not support any version |
| 635 |
of RSS. Use Atom 1.0 for feed documents.</p></dd> |
of RSS. Use Atom 1.0 for feed documents.</p></dd> |
| 636 |
<dt><code>feed</code> element</dt> |
<dt><code>feed</code> element</dt> |
| 637 |
<dd><p>The Atom <code>feed</code> element must be |
<dd><p>The Atom <code>feed</code> element must be |
| 638 |
in the <code>http://www.w3.org/2004/Atom</code> |
in the <code>http://www.w3.org/2005/Atom</code> |
| 639 |
namespace.</p> |
namespace as: |
| 640 |
|
<pre class="xml example"> |
| 641 |
|
<code><feed xmlns="http://www.w3.org/2005/Atom"></code></pre> |
| 642 |
|
</p> |
| 643 |
<p>The conformance checker does not support Atom 0.3. |
<p>The conformance checker does not support Atom 0.3. |
| 644 |
Use Atom 1.0 for feed documents.</p></dd> |
Use Atom 1.0 for feed documents.</p></dd> |
| 645 |
</dl> |
</dl> |
| 764 |
|
|
| 765 |
<dl> |
<dl> |
| 766 |
<dt>HTML <code>meta</code> element, <code>http-equiv</code> attribute</dt> |
<dt>HTML <code>meta</code> element, <code>http-equiv</code> attribute</dt> |
| 767 |
<dd><p>Only <code>Default-Style</code> and <code>Refresh</code> |
<dd><p>Only values <code>Default-Style</code> and <code>Refresh</code> |
| 768 |
is allowed.</p> |
are allowed.</p> |
| 769 |
<p>Value <code>Content-Type</code> is obsolete; for charset |
<p>Value <code>Content-Type</code> is obsolete; for charset |
| 770 |
declaration, the <code>charset</code> attribute can be used as: |
declaration, the <code>charset</code> attribute can be used as: |
| 771 |
<pre class="html example"> |
<pre class="html example"> |
| 784 |
</div> |
</div> |
| 785 |
|
|
| 786 |
<div class="section attribute-value-error" id="enumerated:invalid:http-equiv:content-type"><h3>Charset declaration syntax |
<div class="section attribute-value-error" id="enumerated:invalid:http-equiv:content-type"><h3>Charset declaration syntax |
| 787 |
<code><meta http-equiv="Content-Type" content="text/html; charset=<var>charset-name</var>"></code> |
<code class="html bad example"><meta http-equiv="Content-Type" content="text/html; charset=<var>charset-name</var>"></code> |
| 788 |
is obsolete.</h3> |
is obsolete.</h3> |
| 789 |
<p>Old long charset declaration syntax |
<p>Old long charset declaration syntax |
| 790 |
<code><meta http-equiv="Content-Type" content="text/html; charset=<var>charset-name</var>"></code> |
<code class="html bad example"><meta http-equiv="Content-Type" content="text/html; charset=<var>charset-name</var>"></code> |
| 791 |
is in use. The document is non‐conforming.</p> |
is in use. The document is non‐conforming.</p> |
| 792 |
|
|
| 793 |
<p>The new charset declaration syntax is: |
<p>The new charset declaration syntax is: |
| 794 |
<pre> |
<pre class="html example"> |
| 795 |
<code><meta charset="<var>charset-name</var>"></code></pre> |
<code><meta charset="<var>charset-name</var>"></code></pre> |
| 796 |
</p> |
</p> |
| 797 |
</div> |
</div> |
| 889 |
The document is non-conforming.</p> |
The document is non-conforming.</p> |
| 890 |
|
|
| 891 |
<p>For example, the table below is non-conforming: |
<p>For example, the table below is non-conforming: |
| 892 |
<pre class="html non-conforming example"> |
<pre class="html bad example"> |
| 893 |
<code><table> |
<code><table> |
| 894 |
<tbody> |
<tbody> |
| 895 |
<tr><td rowspan=2></td></tr> |
<tr><td rowspan=2></td></tr> |
| 996 |
<code>text/cache-manifest</code> must contain a cache manifest.</p> |
<code>text/cache-manifest</code> must contain a cache manifest.</p> |
| 997 |
|
|
| 998 |
<p>A cache manifest must start with a line whose content is |
<p>A cache manifest must start with a line whose content is |
| 999 |
<code>CACHE MANIFEST</code> (exactly one space character between |
<code class="manifest example">CACHE MANIFEST</code> |
| 1000 |
|
(exactly one space character between |
| 1001 |
<code>CACHE</code> and <code>MANIFEST</code>).</p> |
<code>CACHE</code> and <code>MANIFEST</code>).</p> |
| 1002 |
</div> |
</div> |
| 1003 |
</section> |
</section> |