48 |
<d:message xml:lang="en">The <code>&</code> character must |
<d:message xml:lang="en">The <code>&</code> character must |
49 |
introduce a reference.</d:message> |
introduce a reference.</d:message> |
50 |
<d:desc xml:lang="en"> |
<d:desc xml:lang="en"> |
51 |
<p>An <code>&</code> (<code>U+0026</code> |
<p>An <code>&</code> character which |
|
<code class="charname">AMPERSAND</code>) character which |
|
52 |
is not part of any reference appears in the input stream. |
is not part of any reference appears in the input stream. |
53 |
The document is non-conforming.</p> |
The document is non‐conforming.</p> |
54 |
|
|
55 |
<p><strong>Any <code>&</code> character in URI (or IRI) |
<p><em>Any <code>&</code> character in URI (or IRI) |
56 |
must be escaped as <code>&amp;</code>.</strong></p> |
must be escaped as <code class="example">&amp;</code>.</em></p> |
57 |
|
|
58 |
<p>The <code>&</code> character must |
<p>The <code>&</code> character must |
59 |
be the first character of a reference: |
be the first character of a reference: |
60 |
<dl> |
<dl class="switch"> |
61 |
<dt>Named entity reference</dt> |
<dt>Named entity reference</dt> |
62 |
<dd><pre class="html example"><code>&<var>entity-name</var>;</code></pre> |
<dd><pre class="html example"><code>&<var>entity-name</var>;</code></pre> |
63 |
where <var>entity-name</var> is the name of the |
where <var>entity-name</var> is the name of the |
133 |
|
|
134 |
<p>The string <code>&#</code> must be the first two characters |
<p>The string <code>&#</code> must be the first two characters |
135 |
of a reference: |
of a reference: |
136 |
<dl> |
<dl class="switch"> |
137 |
<dt>Numeric character reference</dt> |
<dt>Numeric character reference</dt> |
138 |
<dd><pre class="html example"><code>&#<var>d</var>;</code></pre> |
<dd><pre class="html example"><code>&#<var>d</var>;</code></pre> |
139 |
where <var>d</var> is the decimal representation of |
where <var>d</var> is the decimal representation of |
188 |
|
|
189 |
<dl class="switch"> |
<dl class="switch"> |
190 |
<dt>Comments</dt> |
<dt>Comments</dt> |
191 |
<dd>In HTML documents, comments must be introduced by |
<dd>In HTML document, comments must be introduced by |
192 |
<code><!--</code> (<code><!</code> <em>immediately</em> followed |
<code class="example"><!--</code> (<code><!</code> |
193 |
|
<em>immediately</em> followed |
194 |
by <em>two</em> <code>-</code>s) and must be terminated by |
by <em>two</em> <code>-</code>s) and must be terminated by |
195 |
<code>--></code>. Strings <code><!</code> not followed |
<code class="example">--></code>. |
196 |
|
Strings <code><!</code> not followed |
197 |
by <code>--</code> and <code><!-</code> not followed by |
by <code>--</code> and <code><!-</code> not followed by |
198 |
<code>-</code> are not valid open delimiters for comments.</dd> |
<code>-</code> are not valid open delimiters for comments.</dd> |
199 |
<dt>Marked sections, including <code>CDATA</code> sections</dt> |
<dt>Marked sections, including <code>CDATA</code> sections</dt> |
200 |
<dd>Marked sections are not allowed in HTML documents.</dd> |
<dd>Marked sections are not allowed in HTML document.</dd> |
201 |
<dt>Markup declarations</dt> |
<dt>Markup declarations</dt> |
202 |
<dd>Markup declarations, except <code>DOCTYPE</code> |
<dd>Markup declarations, except for <code>DOCTYPE</code> |
203 |
and comment declarations, are not allowed in HTML documents.</dd> |
and comment declarations, are not allowed in HTML document.</dd> |
204 |
<dt>String <code><!</code></dt> |
<dt>String <code><!</code></dt> |
205 |
<dd>String <code><!</code> must be escaped as |
<dd>String <code><!</code> must be escaped as |
206 |
<code>&lt;!</code>.</dd> |
<code class="example">&lt;!</code>.</dd> |
207 |
</dl> |
</dl> |
208 |
</d:desc> |
</d:desc> |
209 |
</d:item> |
</d:item> |
278 |
<dt><code><script/></code></dt> |
<dt><code><script/></code></dt> |
279 |
<dd><p>The polytheistic slash cannot be used for <code>script</code> |
<dd><p>The polytheistic slash cannot be used for <code>script</code> |
280 |
element. Even for an empty <code>script</code> element, |
element. Even for an empty <code>script</code> element, |
281 |
there must be an explicit end tag <code></script></code>.</p> |
there must be an explicit end tag |
282 |
|
<code class="html example"></script></code>.</p> |
283 |
|
|
284 |
<p><strong>NOTE</strong>: Though some user agents interpret |
<p><strong>NOTE</strong>: Though some user agents interpret |
285 |
polytheistic slash for <code>script</code> element as the |
polytheistic slash for <code>script</code> element as the |
296 |
to allow polytheistic slash for these elements.</dd> |
to allow polytheistic slash for these elements.</dd> |
297 |
<dt><code><a/></code>, <code><p/></code></dt> |
<dt><code><a/></code>, <code><p/></code></dt> |
298 |
<dd>These elements are not always empty and therefore |
<dd>These elements are not always empty and therefore |
299 |
polytheistic slash is not allowed.</dd> |
polytheistic slash is not allowed. Use explicit end tag |
300 |
|
to represent empty element as: |
301 |
|
<pre class="example html"><code><p></p></code></pre> |
302 |
|
</dd> |
303 |
</dl> |
</dl> |
304 |
|
|
305 |
<p>Note that, unlike in XML, the polytheistic slash has |
<p>Note that, unlike in XML, the polytheistic slash has |
324 |
<dd>An <abbr>XBL</abbr> binding cannot be associated by |
<dd>An <abbr>XBL</abbr> binding cannot be associated by |
325 |
<abbr title="processing instruction">PI</abbr> in <abbr>HTML</abbr> |
<abbr title="processing instruction">PI</abbr> in <abbr>HTML</abbr> |
326 |
document. Use <code>binding</code> property in <abbr>CSS</abbr> |
document. Use <code>binding</code> property in <abbr>CSS</abbr> |
327 |
style sheet.</dd> |
style sheet as: |
328 |
|
<pre class="html example"><code><style> |
329 |
|
p { |
330 |
|
binding: url(binding.xbl); |
331 |
|
} |
332 |
|
</style></code></pre> |
333 |
|
</dd> |
334 |
<dt><code><?xml?></code> (XML declaration)</dt> |
<dt><code><?xml?></code> (XML declaration)</dt> |
335 |
<dd>XML declaration is unnecessary for HTML documents.</dd> |
<dd>XML declaration is unnecessary for HTML documents.</dd> |
336 |
<dt><code><?xml-stylesheet?></code> (XML style sheet |
<dt><code><?xml-stylesheet?></code> (XML style sheet |
338 |
<dd>Use HTML <code>link</code> element with <code>rel</code> |
<dd>Use HTML <code>link</code> element with <code>rel</code> |
339 |
attribute set to <code>stylesheet</code> (or, |
attribute set to <code>stylesheet</code> (or, |
340 |
<code>alternate stylesheet</code> for an alternate style |
<code>alternate stylesheet</code> for an alternate style |
341 |
sheet).</dd> |
sheet). |
342 |
|
<pre class="example html"><code><link rel=stylesheet href="path/to/stylesheet.css"></code></pre> |
343 |
|
</dd> |
344 |
<dt><code><?php?></code> or |
<dt><code><?php?></code> or |
345 |
<code><? <var>... <abbr>PHP</abbr> code ...</var> ?></code> |
<code><? <var>... <abbr>PHP</abbr> code ...</var> ?></code> |
346 |
(<abbr>PHP</abbr> code)</dt> |
(<abbr>PHP</abbr> code)</dt> |
519 |
<dd>Though the element is void in earlier versions of Safari, |
<dd>Though the element is void in earlier versions of Safari, |
520 |
the <code>canvas</code> element is <em>no</em> longer |
the <code>canvas</code> element is <em>no</em> longer |
521 |
defined as empty. There must be an end tag |
defined as empty. There must be an end tag |
522 |
<code></canvas></code>.</dd> |
<code class="html example"></canvas></code>.</dd> |
523 |
</dl> |
</dl> |
524 |
|
|
525 |
<p>Note that misnesting tags, such as |
<p>Note that misnesting tags, such as |
553 |
<d:desc xml:lang="en"> |
<d:desc xml:lang="en"> |
554 |
<p>The document contains a <code>DOCTYPE</code> declaration |
<p>The document contains a <code>DOCTYPE</code> declaration |
555 |
that is different from HTML5 <code>DOCTYPE</code> (i.e. |
that is different from HTML5 <code>DOCTYPE</code> (i.e. |
556 |
<code><!DOCTYPE HTML></code>). The document is non-conforming.</p> |
<code class="example html"><!DOCTYPE HTML></code>). |
557 |
|
The document is non‐conforming.</p> |
558 |
|
|
559 |
<p>The document might or might not be conformant to |
<p>The document might or might not be conformant to |
560 |
some version of HTML. However, conformance to any HTML |
some version of HTML. However, conformance to any HTML |
686 |
block-level content, any inline-level content must be |
block-level content, any inline-level content must be |
687 |
put in e.g. paragraph element such as <code>p</code>.</p> |
put in e.g. paragraph element such as <code>p</code>.</p> |
688 |
<p>For example, an HTML document fragment |
<p>For example, an HTML document fragment |
689 |
<code class="bad example"><div><p>Hello!</p> World!</div></code> |
<code class="html bad example"><div><p>Hello!</p> World!</div></code> |
690 |
is non-conforming, since a word <q>World!</q> does not belong |
is non-conforming, since a word <q>World!</q> does not belong |
691 |
to any paragraph. (If not part of any paragraph, what is |
to any paragraph. (If not part of any paragraph, what is |
692 |
it!?) A conforming example would be: |
it!?) A conforming example would be: |
693 |
<pre class="example"><code><div><p>Hello!</p> <p>World!</p></div></code></pre> |
<pre class="html example"><code><div><p>Hello!</p> <p>World!</p></div></code></pre> |
694 |
</p></dd> |
</p></dd> |
695 |
<dt>If the parent element does <em>not</em> allow |
<dt>If the parent element does <em>not</em> allow |
696 |
block-level elements as content</dt> |
block-level elements as content</dt> |
734 |
|
|
735 |
<dl class="switch"> |
<dl class="switch"> |
736 |
<dt><code>html</code> element in an XHTML document</dt> |
<dt><code>html</code> element in an XHTML document</dt> |
737 |
<dd><p>In an XHTML document, the root <code>html</code> |
<dd><p>In <abbr>XHTML</abbr> document, the root <code>html</code> |
738 |
element must have an <code>xmlns</code> attribute |
element must have an <code>xmlns</code> attribute as: |
739 |
whose value is set to |
<pre class="xml example"><code><html xmlns="http://www.w3.org/1999/xhtml"></code></pre></p></dd> |
|
<code>http://www.w3.org/1999/xhtml</code>.</p></dd> |
|
740 |
<dt><code>rss</code> element</dt> |
<dt><code>rss</code> element</dt> |
741 |
<dd><p>The document is written in some version of RSS.</p> |
<dd><p>The document is written in some version of RSS.</p> |
742 |
<p>The conformance checker does not support any version |
<p>The conformance checker does not support any version |
743 |
of RSS. Use Atom 1.0 for feed documents.</p></dd> |
of RSS. Use Atom 1.0 for feed documents.</p></dd> |
744 |
<dt><code>feed</code> element</dt> |
<dt><code>feed</code> element</dt> |
745 |
<dd><p>The Atom <code>feed</code> element must be |
<dd><p>The Atom <code>feed</code> element must be |
746 |
in the <code>http://www.w3.org/2004/Atom</code> |
in the <code>http://www.w3.org/2005/Atom</code> |
747 |
namespace.</p> |
namespace as: |
748 |
|
<pre class="xml example"><code><feed xmlns="http://www.w3.org/2005/Atom"></code></pre> |
749 |
|
</p> |
750 |
<p>The conformance checker does not support Atom 0.3. |
<p>The conformance checker does not support Atom 0.3. |
751 |
Use Atom 1.0 for feed documents.</p></dd> |
Use Atom 1.0 for feed documents.</p></dd> |
752 |
</dl> |
</dl> |
901 |
|
|
902 |
<dl> |
<dl> |
903 |
<dt>HTML <code>meta</code> element, <code>http-equiv</code> attribute</dt> |
<dt>HTML <code>meta</code> element, <code>http-equiv</code> attribute</dt> |
904 |
<dd><p>Only <code>Default-Style</code> and <code>Refresh</code> |
<dd><p>Only values <code>Default-Style</code> and <code>Refresh</code> |
905 |
is allowed.</p> |
are allowed.</p> |
906 |
<p>Value <code>Content-Type</code> is obsolete; for charset |
<p>Value <code>Content-Type</code> is obsolete; for charset |
907 |
declaration, the <code>charset</code> attribute can be used as: |
declaration, the <code>charset</code> attribute can be used as: |
908 |
<pre class="html example"><code><meta charset="<var>charset-name</var>"></code></pre> |
<pre class="html example"><code><meta charset="<var>charset-name</var>"></code></pre> |
923 |
<d:item name="enumerated:invalid:http-equiv:content-type" |
<d:item name="enumerated:invalid:http-equiv:content-type" |
924 |
class="attribute-value-error"> |
class="attribute-value-error"> |
925 |
<d:message xml:lang="en">Charset declaration syntax |
<d:message xml:lang="en">Charset declaration syntax |
926 |
<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> |
927 |
is obsolete.</d:message> |
is obsolete.</d:message> |
928 |
<d:desc xml:lang="en"> |
<d:desc xml:lang="en"> |
929 |
<p>Old long charset declaration syntax |
<p>Old long charset declaration syntax |
930 |
<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> |
931 |
is in use. The document is non‐conforming.</p> |
is in use. The document is non‐conforming.</p> |
932 |
|
|
933 |
<p>The new charset declaration syntax is: |
<p>The new charset declaration syntax is: |
934 |
<pre><code><meta charset="<var>charset-name</var>"></code></pre> |
<pre class="html example"><code><meta charset="<var>charset-name</var>"></code></pre> |
935 |
</p> |
</p> |
936 |
</d:desc> |
</d:desc> |
937 |
</d:item> |
</d:item> |
1058 |
The document is non-conforming.</p> |
The document is non-conforming.</p> |
1059 |
|
|
1060 |
<p>For example, the table below is non-conforming: |
<p>For example, the table below is non-conforming: |
1061 |
<pre class="html non-conforming example"><code><table> |
<pre class="html bad example"><code><table> |
1062 |
<tbody> |
<tbody> |
1063 |
<tr><td rowspan=2></td></tr> |
<tr><td rowspan=2></td></tr> |
1064 |
</tbody> |
</tbody> |
1225 |
<code>text/cache-manifest</code> must contain a cache manifest.</p> |
<code>text/cache-manifest</code> must contain a cache manifest.</p> |
1226 |
|
|
1227 |
<p>A cache manifest must start with a line whose content is |
<p>A cache manifest must start with a line whose content is |
1228 |
<code>CACHE MANIFEST</code> (exactly one space character between |
<code class="manifest example">CACHE MANIFEST</code> |
1229 |
|
(exactly one space character between |
1230 |
<code>CACHE</code> and <code>MANIFEST</code>).</p> |
<code>CACHE</code> and <code>MANIFEST</code>).</p> |
1231 |
</d:desc> |
</d:desc> |
1232 |
</d:item> |
</d:item> |