| 3 |
#pattern |
#pattern |
| 4 |
<span class=secno>* </span>The HTML syntax |
<span class=secno>* </span>The HTML syntax |
| 5 |
#ja |
#ja |
|
<span class=secno>$1 </span>HTML 構文 |
|
| 6 |
|
<span class=secno>$1 </span>HTML 構文 |
| 7 |
|
|
| 8 |
|
#pattern |
| 9 |
|
<span class=secno>* </span>Writing HTML documents |
| 10 |
|
#ja |
| 11 |
|
<span class=secno>$1 </span>HTML 文書を書く |
| 12 |
|
|
| 13 |
|
#en |
| 14 |
|
<em>This section only applies to documents, authoring tools, and markup |
| 15 |
|
generators. In particular, it does not apply to conformance checkers; |
| 16 |
|
conformance checkers must use the requirements given in the next section |
| 17 |
|
("parsing HTML documents").</em> |
| 18 |
|
#ja |
| 19 |
|
<em>この節は文書、著述ツール、マーク付け生成器にのみ適用されます。 |
| 20 |
|
特に、適合性検査器には適用されません。 |
| 21 |
|
適合性検査器は次の節 (「HTML 文書の構文解析」) で与えられる要件を用いなければ[[MUST:なりません]]。</em> |
| 22 |
|
|
| 23 |
|
#en |
| 24 |
|
Documents must consist of the following parts, in the given order: |
| 25 |
|
#ja |
| 26 |
|
文書は、次に示す部分により、次の順序で構成されなければ[[MUST:なりません]]。 |
| 27 |
|
|
| 28 |
|
#en |
| 29 |
|
Optionally, a single U+FEFF BYTE ORDER MARK (BOM) character. |
| 30 |
|
#ja |
| 31 |
|
任意選択で、1つの U+FEFF BYTE ORDER MARK (BOM) 文字。 |
| 32 |
|
|
| 33 |
|
#en |
| 34 |
|
Any number of <a href="#comments0" title=syntax-comments>comments</a> |
| 35 |
|
and <a href="#space" title="space character">space characters</a>. |
| 36 |
|
#ja |
| 37 |
|
任意の個数の<a href="#comments0" title=syntax-comments>注釈</a>と<a href="#space" title="space character">間隔文字</a>。 |
| 38 |
|
|
| 39 |
|
#en |
| 40 |
|
A <a href="#doctype5" title=syntax-doctype>DOCTYPE</a>. |
| 41 |
|
#ja |
| 42 |
|
<a href="#doctype5" title=syntax-doctype>DOCTYPE</a>。 |
| 43 |
|
|
| 44 |
|
#en |
| 45 |
|
The root element, in the form of an <code><a |
| 46 |
|
href="#html">html</a></code> <a href="#elements3" |
| 47 |
|
title=syntax-elements>element</a>. |
| 48 |
|
#ja |
| 49 |
|
根要素を <code><a |
| 50 |
|
href="#html">html</a></code> <a href="#elements3" |
| 51 |
|
title=syntax-elements>要素</a>の形で。 |
| 52 |
|
|
| 53 |
|
#en |
| 54 |
|
The various types of content mentioned above are described in the next |
| 55 |
|
few sections. |
| 56 |
|
#ja |
| 57 |
|
前述の各種の内容は、次の数個の節で説明します。 |
| 58 |
|
|
| 59 |
|
#en |
| 60 |
|
In addition, there are some restrictions on how <span>character encoding |
| 61 |
|
declarations</span> are to be serialized, as discussed in the section on |
| 62 |
|
that topic. |
| 63 |
|
#ja |
| 64 |
|
加えて、<span>文字符号化宣言</span>をどう直列化するかについても、 |
| 65 |
|
それに関する節で説明した通り、いくつかの制限があります。 |
| 66 |
|
|
| 67 |
|
#en |
| 68 |
|
Space characters before the root <code><a href="#html">html</a></code> |
| 69 |
|
element, and space characters at the start of the <code><a |
| 70 |
|
href="#html">html</a></code> element and before the <code><a |
| 71 |
|
href="#head">head</a></code> element, will be dropped when the document |
| 72 |
|
is parsed; space characters <em>after</em> the root <code><a |
| 73 |
|
href="#html">html</a></code> element will be parsed as if they were at |
| 74 |
|
the end of the <code><a href="#body0">body</a></code> element. Thus, |
| 75 |
|
space characters around the root element do not round-trip. |
| 76 |
|
#ja |
| 77 |
|
根 <code><a href="#html">html</a></code> 要素の前の間隔文字や、 |
| 78 |
|
<code><a |
| 79 |
|
href="#html">html</a></code> 要素のはじめで <code><a |
| 80 |
|
href="#head">head</a></code> 要素の前の間隔文字は、 |
| 81 |
|
文書が構文解析される時に除去されます。根 <code><a |
| 82 |
|
href="#html">html</a></code> 要素の<em>後</em>の間隔文字は、 |
| 83 |
|
<code><a href="#body0">body</a></code> 要素の終わりにあったものとして構文解析されます。 |
| 84 |
|
従って、根要素の近辺の間隔文字は往復しません。 |
| 85 |
|
|
| 86 |
|
|
| 87 |
|
#en |
| 88 |
|
It is suggested that newlines be inserted after the DOCTYPE, after any |
| 89 |
|
comments that are before the root element, after the <code><a |
| 90 |
|
href="#html">html</a></code> element's start tag (if it is not <a |
| 91 |
|
href="#omitted" title=syntax-tag-omission>omitted</a>), and after any |
| 92 |
|
comments that are inside the <code><a href="#html">html</a></code> |
| 93 |
|
element but before the <code><a href="#head">head</a></code> element. |
| 94 |
|
#ja |
| 95 |
|
DOCTYPE の後、 |
| 96 |
|
根要素の前の注釈がある場合はその後、 |
| 97 |
|
<code><a |
| 98 |
|
href="#html">html</a></code> 要素の開始タグの後 |
| 99 |
|
(<a |
| 100 |
|
href="#omitted" title=syntax-tag-omission>省略</a>しない場合)、 |
| 101 |
|
<code><a href="#html">html</a></code> 要素中で |
| 102 |
|
<code><a href="#head">head</a></code> 要素の前に注釈がある場合にはその後には、 |
| 103 |
|
改行を挿入することをおすすめします。 |
| 104 |
|
|
| 105 |
|
#en |
| 106 |
|
Many strings in the HTML syntax (e.g. the names of elements and their |
| 107 |
|
attributes) are case-insensitive, but only for characters in the ranges |
| 108 |
|
U+0041 .. U+005A (LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z) and |
| 109 |
|
U+0061 .. U+007A (LATIN SMALL LETTER A to LATIN SMALL LETTER Z). For |
| 110 |
|
convenience, in this section this is just referred to as |
| 111 |
|
"case-insensitive". |
| 112 |
|
#ja |
| 113 |
|
HTML 構文中の多くの文字列 (例えば要素や属性の名前) は大文字と小文字を区別しませんが、 |
| 114 |
|
区別しないのは範囲 |
| 115 |
|
U+0041 ~ U+005A (LATIN CAPITAL LETTER A ~ LATIN CAPITAL LETTER Z) と |
| 116 |
|
範囲 U+0061 ~ U+007A (LATIN SMALL LETTER A ~ LATIN SMALL LETTER Z) |
| 117 |
|
の文字についてのみです。便宜上、この節ではこれを単に「大文字・小文字を区別しない」と呼びます。 |
| 118 |
|
|
| 119 |
|
|
| 120 |
|
#pattern |
| 121 |
|
<span class=secno>* </span>The DOCTYPE |
| 122 |
|
#ja |
| 123 |
|
<span class=secno>$1 </span>DOCTYPE |
| 124 |
|
|
| 125 |
|
#en |
| 126 |
|
A <dfn id=doctype5 title=syntax-doctype>DOCTYPE</dfn> is a mostly |
| 127 |
|
useless, but required, header. |
| 128 |
|
#ja |
| 129 |
|
<dfn id=doctype5 title=syntax-doctype>DOCTYPE</dfn> はほとんど無意味ですが、 |
| 130 |
|
[[REQUIRED:必須]]の頭部です。 |
| 131 |
|
|
| 132 |
|
#en |
| 133 |
|
DOCTYPEs are required for legacy reasons. When omitted, |
| 134 |
|
browsers tend to use a different rendering mode that is incompatible with |
| 135 |
|
some specifications. Including the DOCTYPE in a document ensures that the |
| 136 |
|
browser makes a best-effort attempt at following the relevant |
| 137 |
|
specifications. |
| 138 |
|
#ja |
| 139 |
|
DOCTYPE は遺物的な理由で[[REQUIRED:必須]]です。 |
| 140 |
|
省略すると、ブラウザはいくつかの仕様書と非互換な異なるレンダリング・モードを使おうとします。 |
| 141 |
|
DOCTYPE を文書に含めることによってブラウザに関係する仕様書に従うよう最善の努力を試みさせるようにします。 |
| 142 |
|
|
| 143 |
|
#en |
| 144 |
|
A DOCTYPE must consist of the following characters, in this order: |
| 145 |
|
#ja |
| 146 |
|
DOCTYPE は、次の文字により次の順序で構成されなければ[[MUST:なりません]]。 |
| 147 |
|
|
| 148 |
|
#en |
| 149 |
|
A U+003C LESS-THAN SIGN (<code><</code>) character. |
| 150 |
|
#ja |
| 151 |
|
U+003C LESS-THAN SIGN (<code><</code>) 文字。 |
| 152 |
|
|
| 153 |
|
#en |
| 154 |
|
A U+0021 EXCLAMATION MARK (<code>!</code>) character. |
| 155 |
|
#ja |
| 156 |
|
U+0021 EXCLAMATION MARK (<code>!</code>) 文字。 |
| 157 |
|
|
| 158 |
|
#en |
| 159 |
|
A U+0044 LATIN CAPITAL LETTER D or U+0064 LATIN SMALL LETTER D |
| 160 |
|
character. |
| 161 |
|
#ja |
| 162 |
|
U+0044 LATIN CAPITAL LETTER D 文字か U+0064 LATIN SMALL LETTER D 文字。 |
| 163 |
|
|
| 164 |
|
#en |
| 165 |
|
A U+004F LATIN CAPITAL LETTER O or U+006F LATIN SMALL LETTER O |
| 166 |
|
character. |
| 167 |
|
#ja |
| 168 |
|
U+004F LATIN CAPITAL LETTER O 文字か U+006F LATIN SMALL LETTER O 文字。 |
| 169 |
|
|
| 170 |
|
#en |
| 171 |
|
A U+0043 LATIN CAPITAL LETTER C or U+0063 LATIN SMALL LETTER C |
| 172 |
|
character. |
| 173 |
|
#ja |
| 174 |
|
U+0043 LATIN CAPITAL LETTER C 文字か U+0063 LATIN SMALL LETTER C 文字。 |
| 175 |
|
|
| 176 |
|
#en |
| 177 |
|
A U+0054 LATIN CAPITAL LETTER T or U+0074 LATIN SMALL LETTER T |
| 178 |
|
character. |
| 179 |
|
#ja |
| 180 |
|
U+0054 LATIN CAPITAL LETTER T 文字か U+0074 LATIN SMALL LETTER T 文字。 |