1. 4.4 グルヌピングコンテンツ
      1. 4.4.1 p芁玠
      2. 4.4.2 hr芁玠
      3. 4.4.3 pre芁玠
      4. 4.4.4 blockquote芁玠
      5. 4.4.5 ol芁玠
      6. 4.4.6 ul芁玠
      7. 4.4.7 menu芁玠
      8. 4.4.8 li芁玠
      9. 4.4.9 dl芁玠
      10. 4.4.10 dt芁玠
      11. 4.4.11 dd芁玠
      12. 4.4.12 figure芁玠
      13. 4.4.13 figcaption芁玠
      14. 4.4.14 main芁玠
      15. 4.4.15 search芁玠
      16. 4.4.16 div芁玠

4.4 グルヌピングコンテンツ

4.4.1 p芁玠

Element/p

Support in all current engines.

Firefox1+Safari1+Chrome1+
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

HTMLParagraphElement

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
カテゎリヌ
フロヌコンテンツ。
パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
hgroup芁玠の子ずしお。
コンテンツモデル
フレヌゞングコンテンツ。
text/htmlにおけるタグ省略
p芁玠がaddress、article、aside、blockquote、details、dialog、div、dl、fieldset、figcaption、figure、footer、form、h1、h2、h3、h4、h5、h6、header、hgroup、hr、main、menu、nav、ol、p、pre、search、section、table、たたはul芁玠の盎埌に存圚する堎合、たたは芪芁玠で远加のコンテンツが存圚せずか぀芪芁玠がa、audio、del、ins、map、noscript、video芁玠、たたは自埋カスタム芁玠でないHTML芁玠である堎合、p芁玠の終了タグは省略するこずができる。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
[Exposed=Window]
interface HTMLParagraphElement : HTMLElement {
  [HTMLConstructor] constructor();

  // also has obsolete members
};

p芁玠は段萜を衚す。

段萜は通垞、空癜行を介しお隣接するブロックから物理的に分離されるテキストのブロックによっお芖芚メディアで衚珟される䞀方で、スタむルシヌトたたはナヌザヌ゚ヌゞェントは、異なる方法で段萜の区切りを提瀺するこずを同様に正圓化するだろう。䟋ずしおむンラむン段萜蚘号¶の䜿甚が挙げられる。

次の䟋は、適合HTML断片である

<p>The little kitten gently seated herself on a piece of
carpet. Later in her life, this would be referred to as the time the
cat sat on the mat.</p>
<fieldset>
 <legend>Personal information</legend>
 <p>
   <label>Name: <input name="n"></label>
   <label><input name="anon" type="checkbox"> Hide from other users</label>
 </p>
 <p><label>Address: <textarea name="a"></textarea></label></p>
</fieldset>
<p>There was once an example from Femley,<br>
Whose markup was of dubious quality.<br>
The validator complained,<br>
So the author was pained,<br>
To move the error from the markup to the rhyming.</p>

より具䜓的な芁玠がより適切である堎合、p芁玠を䜿甚すべきでない。

次の䟋は、技術的に正しい

<section>
 <!-- ... -->
 <p>Last modified: 2001-04-23</p>
 <p>Author: fred@example.com</p>
</section>

しかし、より望たしいマヌクアップは次のようになる

<section>
 <!-- ... -->
 <footer>Last modified: 2001-04-23</footer>
 <address>Author: fred@example.com</address>
</section>

たたは

<section>
 <!-- ... -->
 <footer>
  <p>Last modified: 2001-04-23</p>
  <address>Author: fred@example.com</address>
 </footer>
</section>

リスト芁玠具䜓的にはolやul芁玠は、p芁玠の子になるこずはできない。したがっお、文曞が箇条曞きのリストを含む堎合、これをどのようにマヌクアップすべきか疑問に思う人がいるかもしれない。

For instance, this fantastic sentence has bullets relating to

and is further discussed below.

その解決法は、HTML甚語においお段萜を理解するこずである。これは論理的な抂念でなく、構造䞊の抂念である。䞊蚘の幻想的な䟋においお、この仕様によっお定矩された、リストの前に1぀、各䞭黒に察するもの、そしおリストの埌に1぀の、5぀の段萜が実際に存圚する。

したがっお、䞊蚘の䟋のマヌクアップは、次のようになる

<p>For instance, this fantastic sentence has bullets relating to</p>
<ul>
 <li>wizards,
 <li>faster-than-light travel, and
 <li>telepathy,
</ul>
<p>and is further discussed below.</p>

耇数の"構造"段萜からなる"論理"段萜のような䟿宜的にスタむル付けを望む著者は、p芁玠の代わりにdiv芁玠を䜿うこずができる。

したがっお、たずえば䞊蚘の䟋は次のようになるかもしれない

<div>For instance, this fantastic sentence has bullets relating to
<ul>
 <li>wizards,
 <li>faster-than-light travel, and
 <li>telepathy,
</ul>
and is further discussed below.</div>

この䟋は、䟝然ずしお5぀の段萜構造を持぀が、今では著者は、個々に䟋の各郚分を考慮する代わりに、divのみでスタむル付けできる。

4.4.2 hr芁玠

Element/hr

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+

HTMLHRElement

Support in all current engines.

Firefox1+Safari1+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
カテゎリヌ
フロヌコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
select芁玠の子孫ずしお。
コンテンツモデル
Nothing。
text/htmlにおけるタグ省略
終了タグなし。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
[Exposed=Window]
interface HTMLHRElement : HTMLElement {
  [HTMLConstructor] constructor();

  // also has obsolete members
};

hr芁玠は、たずえば、ストヌリヌのシヌンの倉曎、参照曞のセクション内の別の話題に移行するなど段萜レベルのテヌマの区切りを衚す。たたは、select芁玠の䞀連のオプション間の区切りを衚す。

プロゞェクトマニュアルからの以䞋における架空の匕甚は、セクション内でトピックを分離するためにhr芁玠を䜿甚する2぀のセクションを瀺す。

<section>
 <h1>Communication</h1>
 <p>There are various methods of communication. This section
 covers a few of the important ones used by the project.</p>
 <hr>
 <p>Communication stones seem to come in pairs and have mysterious
 properties:</p>
 <ul>
  <li>They can transfer thoughts in two directions once activated
  if used alone.</li>
  <li>If used with another device, they can transfer one's
  consciousness to another body.</li>
  <li>If both stones are used with another device, the
  consciousnesses switch bodies.</li>
 </ul>
 <hr>
 <p>Radios use the electromagnetic spectrum in the meter range and
 longer.</p>
 <hr>
 <p>Signal flares use the electromagnetic spectrum in the
 nanometer range.</p>
</section>
<section>
 <h1>Food</h1>
 <p>All food at the project is rationed:</p>
 <dl>
  <dt>Potatoes</dt>
  <dd>Two per day</dd>
  <dt>Soup</dt>
  <dd>One bowl per day</dd>
 </dl>
 <hr>
 <p>Cooking is done by the chefs on a set rotation.</p>
</section>

section芁玠ずh1芁玠はテヌマの倉曎を意味するため、セクション間のhr芁玠は必芁ない。

ピヌタヌ・F・ハミルトン䜜のPandora's Starからの次の抜粋は、シヌンの倉化の前にある2぀の段萜ずそれに続く段萜を瀺す。第2段萜ず第3段萜ずの間の1぀の䞭倮にある星を含むギャップによっお曞籍で衚珟されるシヌンの倉化は、ここにhr芁玠を䜿甚するこずで衚される。

<p>Dudley was ninety-two, in his second life, and fast approaching
time for another rejuvenation. Despite his body having the physical
age of a standard fifty-year-old, the prospect of a long degrading
campaign within academia was one he regarded with dread. For a
supposedly advanced civilization, the Intersolar Commonwealth could be
appallingly backward at times, not to mention cruel.</p>
<p><i>Maybe it won't be that bad</i>, he told himself. The lie was
comforting enough to get him through the rest of the night's
shift.</p>
<hr>
<p>The Carlton AllLander drove Dudley home just after dawn. Like the
astronomer, the vehicle was old and worn, but perfectly capable of
doing its job. It had a cheap diesel engine, common enough on a
semi-frontier world like Gralmond, although its drive array was a
thoroughly modern photoneural processor. With its high suspension and
deep-tread tyres it could plough along the dirt track to the
observatory in all weather and seasons, including the metre-deep snow
of Gralmond's winters.</p>

hr芁玠は、文曞のアりトラむンに圱響を䞎えない。

4.4.3 pre芁玠

Element/pre

Support in all current engines.

Firefox1+Safari4+Chrome1+
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

HTMLPreElement

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer6+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
カテゎリヌ
フロヌコンテンツ。
パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
コンテンツモデル
フレヌゞングコンテンツ。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
[Exposed=Window]
interface HTMLPreElement : HTMLElement {
  [HTMLConstructor] constructor();

  // also has obsolete members
};

pre芁玠は、構造が芁玠によっおではなく印刷芏則によっお衚される、敎圢枈みテキストのブロックを衚す。

HTML構文においお、pre芁玠の開始タグの盎埌にある冒頭の改行文字は取り陀かれる。

pre芁玠を䜿甚できるケヌスの䞀郚の䟋

著者は、音声合成装眮、点字ディスプレむなどのナヌザヌの堎合に、曞匏蚭定が倱われたずきに敎圢枈みテキストを䜓隓する方法を怜蚎するこずが掚奚される。アスキヌアヌトのような堎合、たずえばテキスト蚘述などの代替プレれンテヌションは、文曞の読者にずっお、より普遍的にアクセスできるようになるだろう。

コンピュヌタヌコヌドのブロックを衚すために、pre芁玠は、code芁玠ずずもに䜿甚できる。コンピュヌタヌ出力のブロックを衚すために、pre芁玠は、samp芁玠ずずもに䜿甚できる。同様に、kbd芁玠は、ナヌザヌが入力するテキストを瀺すために、pre芁玠内で䜿甚できる。

この芁玠は、双方向アルゎリズムに関わるレンダリング芁件を持぀。

次の断片においお、コンピュヌタヌコヌドのサンプルが提瀺される。

<p>This is the <code>Panel</code> constructor:</p>
<pre><code>function Panel(element, canClose, closeHandler) {
  this.element = element;
  this.canClose = canClose;
  this.closeHandler = function () { if (closeHandler) closeHandler() };
}</code></pre>

次の断片においお、sampずkbd芁玠は、『ゟヌクⅠ』のセッションを衚瀺するために、pre芁玠のコンテンツで混合される。

<pre><samp>You are in an open field west of a big white house with a boarded
front door.
There is a small mailbox here.

></samp> <kbd>open mailbox</kbd>

<samp>Opening the mailbox reveals:
A leaflet.

></samp></pre>

以䞋は、詩自䜓の本質的な郚分を圢成する、その独特な曞匏蚭定を保持するためにpre芁玠を䜿甚する、珟代的な詩を瀺す。

<pre>                maxling

it is with a          heart
               heavy

that i admit loss of a feline
        so           loved

a friend lost to the
        unknown
                                (night)

~cdr 11dec07</pre>

4.4.4 blockquote芁玠

Element/blockquote

Support in all current engines.

Firefox1+Safari4+Chrome1+
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

HTMLQuoteElement

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer6+
Firefox Android?Safari iOS1+Chrome Android?WebView Android37+Samsung Internet?Opera Android12.1+
カテゎリヌ
フロヌコンテンツ。
パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
コンテンツモデル
フロヌコンテンツ。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
cite — 線集に関する匕甚たたはより倚くの情報源ぞのリンク
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
属性citeを䌎っおデフォルト。
DOMむンタヌフェむス
[Exposed=Window]
interface HTMLQuoteElement : HTMLElement {
  [HTMLConstructor] constructor();

  [CEReactions, ReflectURL] attribute USVString cite;
};

HTMLQuoteElementむンタヌフェむスはたた、q芁玠によっおも䜿甚される。

blockquote芁玠は別の゜ヌスから匕甚されおいるセクションを衚す。

blockquote芁玠内のコンテンツは、別の゜ヌスから匕甚されなければならず、そのアドレスがある堎合、cite属性で匕甚しおもよい。

cite属性が存圚する堎合、朜圚的にスペヌスで囲たれた劥圓なURLでなければならない。察応する匕甚リンクを取埗するために、属性倀は、芁玠のノヌド文曞に察しお解析されなければならない。ナヌザヌ゚ヌゞェントは、ナヌザヌがそのような匕甚のリンクをたどるこずを可胜にしおもよいが、これは䞻に読者のためでなく、たずえば匕甚のサむトの䜿甚に関する統蚈を収集するサヌバヌサむドスクリプトによっおなど私的䜿甚のために意図される。

blockquote芁玠のコンテンツは短瞮されおもよく、たたテキストの蚀語に察する埓来の方法でコンテキストを远加しおいおもよい。

たずえば、英語においおこれは、䌝統的に角括匧を䜿甚しお行われる。"Jane ate the cracker. He then said he liked apples and fish."ずいう文をも぀ペヌゞを考えおみよう。これは次のように匕甚されるかもしれない

<blockquote>
 <p>[Jane] then said she liked [...] fish.</p>
</blockquote>

匕甚に察する垰属は、もしあれば、blockquote芁玠の倖偎に配眮しなければならない。

たずえば、垰属が匕甚のあずに段萜で䞎えられる

<blockquote>
 <p>I contend that we are both atheists. I just believe in one fewer
 god than you do. When you understand why you dismiss all the other
 possible gods, you will understand why I dismiss yours.</p>
</blockquote>
<p>— Stephen Roberts</p>

次の䟋は、垰属を瀺す他の方法を瀺す。

これは、blockquote芁玠は、その属性これは匕甚の䞀郚ではなく、したがっおblockquote芁玠自身の内郚に属さないぞの匕甚を明確に関連付けるfigure芁玠ずそのfigcaptionず組み合わせお䜿甚される

<figure>
 <blockquote>
  <p>The truth may be puzzling. It may take some work to grapple with.
  It may be counterintuitive. It may contradict deeply held
  prejudices. It may not be consonant with what we desperately want to
  be true. But our preferences do not determine what's true. We have a
  method, and that method helps us to reach not absolute truth, only
  asymptotic approaches to the truth — never there, just closer
  and closer, always finding vast new oceans of undiscovered
  possibilities. Cleverly designed experiments are the key.</p>
 </blockquote>
 <figcaption>Carl Sagan, in "<cite>Wonder and Skepticism</cite>", from
 the <cite>Skeptical Inquirer</cite> Volume 19, Issue 1 (January-February
 1995)</figcaption>
</figure>

次の䟋は、blockquoteず同時にciteの䜿甚方法を瀺す

<p>His next piece was the aptly named <cite>Sonnet 130</cite>:</p>
<blockquote cite="https://quotes.example.org/s/sonnet130.html">
  <p>My mistress' eyes are nothing like the sun,<br>
  Coral is far more red, than her lips red,<br>
  ...

この䟋は、フォヌラムの投皿で、どの投皿がナヌザヌが返信しおいるものかを衚瀺するためにblockquoteを䜿甚する様子を瀺す。article芁玠は、スレッドをマヌクアップするために各投皿に察しお䜿甚される。

<article>
 <h1><a href="https://bacon.example.com/?blog=109431">Bacon on a crowbar</a></h1>
 <article>
  <header><strong>t3yw</strong> 12 points 1 hour ago</header>
  <p>I bet a narwhal would love that.</p>
  <footer><a href="?pid=29578">permalink</a></footer>
  <article>
   <header><strong>greg</strong> 8 points 1 hour ago</header>
   <blockquote><p>I bet a narwhal would love that.</p></blockquote>
   <p>Dude narwhals don't eat bacon.</p>
   <footer><a href="?pid=29579">permalink</a></footer>
   <article>
    <header><strong>t3yw</strong> 15 points 1 hour ago</header>
    <blockquote>
     <blockquote><p>I bet a narwhal would love that.</p></blockquote>
     <p>Dude narwhals don't eat bacon.</p>
    </blockquote>
    <p>Next thing you'll be saying they don't get capes and wizard
    hats either!</p>
    <footer><a href="?pid=29580">permalink</a></footer>
    <article>
     <article>
      <header><strong>boing</strong> -5 points 1 hour ago</header>
      <p>narwhals are worse than ceiling cat</p>
      <footer><a href="?pid=29581">permalink</a></footer>
     </article>
    </article>
   </article>
  </article>
  <article>
   <header><strong>fred</strong> 1 points 23 minutes ago</header>
   <blockquote><p>I bet a narwhal would love that.</p></blockquote>
   <p>I bet they'd love to peel a banana too.</p>
   <footer><a href="?pid=29582">permalink</a></footer>
  </article>
 </article>
</article>

この䟋は、blockquote芁玠の内郚にp芁玠を䜿甚する必芁がないこずを説明する、短い断片に察するblockquote芁玠の甚法を瀺す。

<p>He began his list of "lessons" with the following:</p>
<blockquote>One should never assume that his side of
the issue will be recognized, let alone that it will
be conceded to have merits.</blockquote>
<p>He continued with a number of similar points, ending with:</p>
<blockquote>Finally, one should be prepared for the threat
of breakdown in negotiations at any given moment and not
be cowed by the possibility.</blockquote>
<p>We shall now discuss these points...

䌚話を衚珟する方法の䟋は、埌の節で瀺される。この目的でciteずblockquote芁玠を䜿甚するこずは適切でない。

4.4.5 ol芁玠

Element/ol

Support in all current engines.

Firefox1+Safari4+Chrome1+
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

HTMLOListElement

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
カテゎリヌ
フロヌコンテンツ。
芁玠の子が少なくずも1぀のli芁玠を含む堎合パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
コンテンツモデル
0個以䞊のli芁玠およびスクリプトサポヌト芁玠。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
reversed — リストの逆順の数
start — リストの開始倀
type — リストマヌカヌの皮類
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
属性reversed、start、typeを䌎っおデフォルト。
DOMむンタヌフェむス
[Exposed=Window]
interface HTMLOListElement : HTMLElement {
  [HTMLConstructor] constructor();

  [CEReactions, Reflect] attribute boolean reversed;
  [CEReactions, Reflect, ReflectDefault=1] attribute long start;
  [CEReactions, Reflect] attribute DOMString type;

  // also has obsolete members
};

ol芁玠は、順序を倉曎するこずが文曞の意味を倉曎するような、意図的に順序付けられた項目のリストを衚す。

リストの項目は、ツリヌ順でol芁玠のli芁玠の子ノヌドである。

Element/ol#attr-reversed

Support in all current engines.

Firefox18+Safari6+Chrome18+
Opera?Edge79+
Edge (Legacy)≀79+Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

reversed属性は、真停属性である。存圚する堎合、リストが降順リストであるこずを瀺す..., 3, 2, 1。属性が省略される堎合、リストは昇順リストである1, 2, 3, ...。

存圚する堎合、start属性は、劥圓な敎数でなければならない。これはリストの開始倀を決定するために䜿甚される。

An ol element has a starting value, which is an integer determined as follows:

  1. If the ol element has a start attribute:

    1. Let parsed be the result of parsing the value of the attribute as an integer.

    2. If parsed is not an error, then return parsed.

  2. If the ol element has a reversed attribute, then return the number of owned li elements.

  3. Return 1.

type属性は、重芁な堎合たずえば、項目が数字たたは文字によっお参照されるこずがあるためなど、リストで䜿甚するマヌカヌの皮類を指定するために䜿甚できる。指定された堎合、属性は、次の衚の行の1぀の最初のセルで䞎えられた文字の1぀ず同䞀ずなる倀を持たなければならない。The type attribute represents the state given in the cell in the second column of the row whose first cell matches the attribute's value; if none of the cells match, or if the attribute is omitted, then the attribute represents the decimal state.

キヌワヌド状態説明倀1-3および3999-4001に察する䟋
1 (U+0031)decimal10進数1.2.3....3999.4000.4001....
a (U+0061)lower-alpha小文字のアルファベットa.b.c....ewu.ewv.eww....
A (U+0041)upper-alpha倧文字のアルファベットA.B.C....EWU.EWV.EWW....
i (U+0069)lower-roman小文字のロヌマ数字i.ii.iii....mmmcmxcix.i̅v̅.i̅v̅i....
I (U+0049)upper-roman倧文字のロヌマ数字I.II.III....MMMCMXCIX.I̅V̅.I̅V̅I....

ナヌザヌ゚ヌゞェントは、ol芁玠のtype属性の状態ず䞀臎する方法で、リストの項目をレンダリングすべきである。0以䞋の数字は、type属性に関係なく10進法を垞に䜿甚すべきである。

For CSS user agents, a mapping for this attribute to the 'list-style-type' CSS property is given in the Rendering section (the mapping is straightforward: the states above have the same names as their corresponding CSS values).

これは、CSSナヌザヌ゚ヌゞェントにおけるこの属性を実装するために䜿甚されるデフォルトCSSリストスタむルを定矩するこずを可胜にする。そうするこずは、リスト項目がレンダリングされる方法に圱響を䞎える。

Due to [ReflectDefault] the start IDL attribute does not necessarily match the list's starting value, in cases where the start content attribute is omitted and the reversed content attribute is specified.

次のマヌクアップは、順序が重芁である所でリストを瀺しおおり、したがっお、ol芁玠は適切である。ul芁玠を䜿甚する同じ項目の䟋を芋るにはulセクションで同等のリストずこのリストを比范する。

<p>I have lived in the following countries (given in the order of when
I first lived there):</p>
<ol>
 <li>Switzerland
 <li>United Kingdom
 <li>United States
 <li>Norway
</ol>

リストの順序を倉曎するず、どのように文曞の意味が倉化するかに泚意する。次の䟋は、最初の2぀の項目にある盞察順序を倉曎するこずで、著者の故郷を倉曎しおいる

<p>I have lived in the following countries (given in the order of when
I first lived there):</p>
<ol>
 <li>United Kingdom
 <li>Switzerland
 <li>United States
 <li>Norway
</ol>

4.4.6 ul芁玠

Element/ul

Support in all current engines.

Firefox1+Safari4+Chrome1+
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

HTMLUListElement

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
カテゎリヌ
フロヌコンテンツ。
芁玠の子が少なくずも1぀のli芁玠を含む堎合パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
コンテンツモデル
0個以䞊のli芁玠およびスクリプトサポヌト芁玠。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
[Exposed=Window]
interface HTMLUListElement : HTMLElement {
  [HTMLConstructor] constructor();

  // also has obsolete members
};

ul芁玠は、項目の順序が重芁でない―順序を倉曎しおも、文曞の意味を実質的に倉えないだろう、項目のリストを衚す。

リストの項目は、ul芁玠のli芁玠の子ノヌドである。

次のマヌクアップは、順序が重芁でないリストを瀺しおおり、したがっお、ul芁玠は適切である。ol芁玠を䜿甚する同じ項目の䟋を芋るにはolセクションで同等のリストずこのリストを比范する。

<p>I have lived in the following countries:</p>
<ul>
 <li>Norway
 <li>Switzerland
 <li>United Kingdom
 <li>United States
</ul>

リストの順序を倉曎するこずが、文曞の意味を倉曎しないこずに泚意する。䞊蚘の断片内の項目はアルファベット順に蚘茉されるが、䞋蚘の断片においお、文曞の意味を倉えるこずなく、2007幎における経垞収支の倧きさの順に䞎えられる

<p>I have lived in the following countries:</p>
<ul>
 <li>Switzerland
 <li>Norway
 <li>United Kingdom
 <li>United States
</ul>

4.4.7 menu芁玠

Element/menu

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer6+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+

HTMLMenuElement

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer6+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
カテゎリヌ
フロヌコンテンツ。
芁玠の子が少なくずも1぀のli芁玠を含む堎合パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
コンテンツモデル
0個以䞊のli芁玠およびスクリプトサポヌト芁玠。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
[Exposed=Window]
interface HTMLMenuElement : HTMLElement {
  [HTMLConstructor] constructor();

  // also has obsolete members
};

menu芁玠は、li芁玠で衚される項目の順䞍同のリストの圢匏で、そのコンテンツからなるツヌルバヌを衚す。各芁玠はナヌザヌが実行たたはアクティブにできるコマンドを衚す。

menu芁玠は、順䞍同のコマンドのリスト"ツヌルバヌ"を衚珟するための、単にulぞのセマンティックな代替手段である。

この䟋では、䞀連の線集コマンドを提䟛するためにテキスト線集アプリケヌションはmenu芁玠を䜿甚する

<menu>
 <li><button onclick="copy()"><img src="copy.svg" alt="Copy"></button></li>
 <li><button onclick="cut()"><img src="cut.svg" alt="Cut"></button></li>
 <li><button onclick="paste()"><img src="paste.svg" alt="Paste"></button></li>
</menu>

埓来のツヌルバヌメニュヌのように芋えるようにするスタむルは、アプリケヌションによっお異なるこずに泚意する。

4.4.8 li芁玠

Element/li

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+

HTMLLIElement

Support in all current engines.

Firefox1+Safari1+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
カテゎリヌ
なし。
この芁玠を䜿甚できるコンテキスト
ol芁玠の内偎。
ul芁玠の内偎。
menu芁玠の内偎。
コンテンツモデル
フロヌコンテンツ。
text/htmlにおけるタグ省略
li芁玠が別のli芁玠の盎埌に存圚する堎合、たたは芪芁玠に远加のコンテンツが存圚しない堎合、li芁玠の終了タグは省略するこずができる。
コンテンツ属性
グロヌバル属性
芁玠がulたたはmenu芁玠の子でない堎合value — リスト項目の順序倀
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
属性valueを䌎っおデフォルト。
DOMむンタヌフェむス
[Exposed=Window]
interface HTMLLIElement : HTMLElement {
  [HTMLConstructor] constructor();

  [CEReactions, Reflect] attribute long value;

  // also has obsolete members
};

li芁玠は、リスト項目を衚す。芪芁玠がol、ul、たたはmenu芁玠の堎合、芁玠は、それらの芁玠に察しお定矩されるような、芪芁玠のリスト項目である。そうでなければ、リスト項目は、他のli芁玠にリスト関連の関係を定矩されおいない。

存圚する堎合、value属性は、劥圓な敎数でなければならない。liのリストオヌナヌがol芁玠である堎合、リスト項目の順序倀を決定するために䜿甚される。


Any element whose computed value of 'display' is 'list-item' has a list owner, which is determined as follows:

  1. If the element is not being rendered, return null; the element has no list owner.

  2. Let ancestor be the element's parent.

  3. If the element has an ol, ul, or menu ancestor, set ancestor to the closest such ancestor element.

  4. Return the closest inclusive ancestor of ancestor that produces a CSS box.

    Such an element will always exist, as at the very least the document element will always produce a CSS box.

To determine the ordinal value of each element owned by a given list owner owner, perform the following steps:

  1. Let i be 1.

  2. If owner is an ol element, let numbering be owner's starting value. Otherwise, let numbering be 1.

  3. Loop: If i is greater than the number of list items that owner owns, then return; all of owner's owned list items have been assigned ordinal values.

  4. Let item be the ith of owner's owned list items, in tree order.

  5. If item is an li element that has a value attribute:

    1. Let parsed be the result of parsing the value of the attribute as an integer.

    2. If parsed is not an error, then set numbering to parsed.

  6. The ordinal value of item is numbering.

  7. If owner is an ol element, and owner has a reversed attribute, decrement numbering by 1; otherwise, increment numbering by 1.

  8. Increment i by 1.

  9. Go to the step labeled loop.


The element's value IDL attribute does not directly correspond to its ordinal value; it simply reflects the content attribute. For example, given this list:

<ol>
 <li>Item 1
 <li value="3">Item 3
 <li>Item 4
</ol>

The ordinal values are 1, 3, and 4, whereas the value IDL attributes return 0, 3, 0 on getting.

次の䟋は、トップ10の映画が逆順で蚘茉される。リストがfigure芁玠ずfigcaption芁玠を䜿甚しお、タむトルを䞎えられる様子に泚意する。

<figure>
 <figcaption>The top 10 movies of all time</figcaption>
 <ol>
  <li value="10"><cite>Josie and the Pussycats</cite>, 2001</li>
  <li value="9"><cite lang="sh">ЊрМа Ќачка, белО ЌачПр</cite>, 1998</li>
  <li value="8"><cite>A Bug's Life</cite>, 1998</li>
  <li value="7"><cite>Toy Story</cite>, 1995</li>
  <li value="6"><cite>Monsters, Inc</cite>, 2001</li>
  <li value="5"><cite>Cars</cite>, 2006</li>
  <li value="4"><cite>Toy Story 2</cite>, 1999</li>
  <li value="3"><cite>Finding Nemo</cite>, 2003</li>
  <li value="2"><cite>The Incredibles</cite>, 2004</li>
  <li value="1"><cite>Ratatouille</cite>, 2007</li>
 </ol>
</figure>

マヌクアップはたた、ol芁玠にreversed属性を䜿甚しお、次のように蚘述できる

<figure>
 <figcaption>The top 10 movies of all time</figcaption>
 <ol reversed>
  <li><cite>Josie and the Pussycats</cite>, 2001</li>
  <li><cite lang="sh">ЊрМа Ќачка, белО ЌачПр</cite>, 1998</li>
  <li><cite>A Bug's Life</cite>, 1998</li>
  <li><cite>Toy Story</cite>, 1995</li>
  <li><cite>Monsters, Inc</cite>, 2001</li>
  <li><cite>Cars</cite>, 2006</li>
  <li><cite>Toy Story 2</cite>, 1999</li>
  <li><cite>Finding Nemo</cite>, 2003</li>
  <li><cite>The Incredibles</cite>, 2004</li>
  <li><cite>Ratatouille</cite>, 2007</li>
 </ol>
</figure>

li芁玠の内偎の芋出し芁玠たずえばh1を含むこずは適合するが、それはおそらく著者が意図したセマンティックスを䌝えるこずはない。芋出しは新しいセクションを開始し、リストの芋出しが暗黙的に耇数のセクションにたたがるようにリストを分割する。

4.4.9 dl芁玠

Element/dl

Support in all current engines.

Firefox1+Safari4+Chrome1+
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

HTMLDListElement

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
カテゎリヌ
フロヌコンテンツ。
芁玠の子が少なくずも1぀の名前-倀グルヌプを含む堎合パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
コンテンツモデル
1぀以䞊のdt芁玠の埌に来る1぀以䞊のdd芁玠からなり、任意でスクリプトサポヌト芁玠ず混合される0個以䞊のグルヌプ。
たたはオプションでスクリプトサポヌト芁玠ず混合される、1぀以䞊のdiv芁玠。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
[Exposed=Window]
interface HTMLDListElement : HTMLElement {
  [HTMLConstructor] constructor();

  // also has obsolete members
};

dl芁玠は、0個以䞊の名前-倀グルヌプ蚘述リストから成る連想リストを衚す。名前-倀グルヌプは、dtおよびdd芁玠の子、ならびにdiv芁玠の子であるdtおよびdd芁玠以倖のすべおのノヌドを拒吊し、1぀以䞊の名前dt芁玠、堎合によりdiv芁玠の子ずしおに続き1぀以䞊の倀dd芁玠、堎合によりdiv芁玠の子ずしおで構成されなければならない。単䞀のdl芁玠内で、それぞれの名前に察しお耇数のdt芁玠が存圚すべきでない。

名前-倀グルヌプは、甚語ずその定矩、メタデヌタの芋出しや倀、質問ず回答、たたは名前-倀のデヌタのグルヌプであっおもよい。

グルヌプ内の倀は、代替手段である。同じ倀の䞀郚を圢成する耇数の段萜がすべお同じdd芁玠内に指定されなければならない。

グルヌプ、および各グルヌプ内の名前ず倀のリストの順序は、意味があっおもよい。

Microdata属性、たたはグルヌプ党䜓に適甚される他のグロヌバル属性たたは単にスタむル目的でグルヌプに泚釈付するために、dl内の各グルヌプは、div芁玠で包むこずができる。これは、dl芁玠のセマンティックスを倉曎しない。

The name-value groups of a dl element dl are determined using the following algorithm. A name-value group has a name (a list of dt elements, initially empty) and a value (a list of dd elements, initially empty).

  1. Let groups be an empty list of name-value groups.

  2. Let current be a new name-value group.

  3. Let seenDd be false.

  4. Let child be dl's first child.

  5. Let grandchild be null.

  6. While child is not null:

    1. If child is a div element:

      1. Let grandchild be child's first child.

      2. While grandchild is not null:

        1. Process dt or dd for grandchild.

        2. Set grandchild to grandchild's next sibling.

    2. Otherwise, process dt or dd for child.

    3. Set child to child's next sibling.

  7. If current is not empty, then append current to groups.

  8. Return groups.

To process dt or dd for a node node means to follow these steps:

  1. Let groups, current, and seenDd be the same variables as those of the same name in the algorithm that invoked these steps.

  2. If node is a dt element:

    1. If seenDd is true, then append current to groups, set current to a new name-value group, and set seenDd to false.

    2. Append node to current's name.

  3. Otherwise, if node is a dd element, then append node to current's value and set seenDd to true.

名前-倀グルヌプが名前たたは倀ずしお空のリストを持぀堎合、倚くの堎合dt芁玠の代わりにdd芁玠を、たたはその逆を誀っお䜿甚する原因ずなる。適合性チェッカヌは、そのような間違いを芋぀けるこずができ、マヌクアップを正しく䜿甚する方法を著者に助蚀するこずができるかもしれない。

次の䟋は、1぀の゚ントリヌ"Authors"が、2぀の倀"John"ず"Luke"にリンクされる。

<dl>
 <dt> Authors
 <dd> John
 <dd> Luke
 <dt> Editor
 <dd> Frank
</dl>

次の䟋は、1぀の定矩が2぀の甚語にリンクされる。

<dl>
 <dt lang="en-US"> <dfn>color</dfn> </dt>
 <dt lang="en-GB"> <dfn>colour</dfn> </dt>
 <dd> A sensation which (in humans) derives from the ability of
 the fine structure of the eye to distinguish three differently
 filtered analyses of a view. </dd>
</dl>

次の䟋は、ある皮のメタデヌタをマヌクアップするdl芁玠の䜿甚䟋を瀺す。䟋の最埌で、1぀のグルヌプは、2぀のメタデヌタラベル"Authors"ず"Editors"ず2぀の倀"Robert Rothman"ず"Daniel Jackson"を持぀。この䟋はたた、スタむリングを支揎するために、dtずdd芁玠のグルヌプの呚囲にdiv芁玠を䜿う。

<dl>
 <div>
  <dt> Last modified time </dt>
  <dd> 2004-12-23T23:33Z </dd>
 </div>
 <div>
  <dt> Recommended update interval </dt>
  <dd> 60s </dd>
 </div>
 <div>
  <dt> Authors </dt>
  <dt> Editors </dt>
  <dd> Robert Rothman </dd>
  <dd> Daniel Jackson </dd>
 </div>
</dl>

次の䟋は、䞀連の呜什を䞎えるために䜿われるdl芁玠を瀺す。ここで、呜什の順序が重芁である他の䟋においお、ブロックの順序は重芁ではなかった。

<p>Determine the victory points as follows (use the
first matching case):</p>
<dl>
 <dt> If you have exactly five gold coins </dt>
 <dd> You get five victory points </dd>
 <dt> If you have one or more gold coins, and you have one or more silver coins </dt>
 <dd> You get two victory points </dd>
 <dt> If you have one or more silver coins </dt>
 <dd> You get one victory point </dd>
 <dt> Otherwise </dt>
 <dd> You get no victory points </dd>
</dl>

次の断片は、甚語集ずしお䜿甚されるdl芁玠を瀺す。定矩されおいる単語を瀺すためのdfnの䜿甚に泚意する。

<dl>
 <dt><dfn>Apartment</dfn>, n.</dt>
 <dd>An execution context grouping one or more threads with one or
 more COM objects.</dd>
 <dt><dfn>Flat</dfn>, n.</dt>
 <dd>A deflated tire.</dd>
 <dt><dfn>Home</dfn>, n.</dt>
 <dd>The user's login directory.</dd>
</dl>

この䟋は、フレンチレストランでアむスクリヌムデザヌトを泚釈付けするために、div芁玠ず共に、dl芁玠でmicrodata属性を䜿甚する。

<dl>
 <div itemscope itemtype="http://schema.org/Product">
  <dt itemprop="name">Café ou Chocolat Liégeois
  <dd itemprop="offers" itemscope itemtype="http://schema.org/Offer">
   <span itemprop="price">3.50</span>
   <data itemprop="priceCurrency" value="EUR">€</data>
  <dd itemprop="description">
   2 boules Café ou Chocolat, 1 boule Vanille, sauce café ou chocolat, chantilly
 </div>

 <div itemscope itemtype="http://schema.org/Product">
  <dt itemprop="name">Américaine
  <dd itemprop="offers" itemscope itemtype="http://schema.org/Offer">
   <span itemprop="price">3.50</span>
   <data itemprop="priceCurrency" value="EUR">€</data>
  <dd itemprop="description">
   1 boule CrÚme brûlée, 1 boule Vanille, 1 boule Caramel, chantilly
 </div>
</dl>

div芁玠のないマヌクアップは、次のように、項目をも぀dd芁玠内のデヌタをリンクするためにitemref属性を䜿甚する必芁がある。

<dl>
 <dt itemscope itemtype="http://schema.org/Product" itemref="1-offer 1-description">
  <span itemprop="name">Café ou Chocolat Liégeois</span>
 <dd id="1-offer" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  <span itemprop="price">3.50</span>
  <data itemprop="priceCurrency" value="EUR">€</data>
 <dd id="1-description" itemprop="description">
  2 boules Café ou Chocolat, 1 boule Vanille, sauce café ou chocolat, chantilly

 <dt itemscope itemtype="http://schema.org/Product" itemref="2-offer 2-description">
  <span itemprop="name">Américaine</span>
 <dd id="2-offer" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  <span itemprop="price">3.50</span>
  <data itemprop="priceCurrency" value="EUR">€</data>
 <dd id="2-description" itemprop="description">
  1 boule CrÚme brûlée, 1 boule Vanille, 1 boule Caramel, chantilly
</dl>

dl芁玠は、䌚話をマヌクアップするのに䞍適切である。䌚話のマヌクアップする方法の䟋も参照のこず。

4.4.10 dt芁玠

Element/dt

Support in all current engines.

Firefox1+Safari4+Chrome1+
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?
カテゎリヌ
なし。
この芁玠を䜿甚できるコンテキスト
dl芁玠の内郚でddたたはdt芁玠の前。
dl芁玠の子であるdiv芁玠内のddたたはdt芁玠の前。
コンテンツモデル
フロヌコンテンツ、ただしheader、footer、セクショニングコンテンツ、たたはヘディングコンテンツの子孫を陀く。
text/htmlにおけるタグ省略
dt芁玠が別のdt芁玠たたはdd芁玠の盎埌に存圚する堎合、dt芁玠の終了タグは省略するこずができる。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
HTMLElementを䜿甚する。

dt芁玠は、蚘述リストdl芁玠内の甚語・説明グルヌプの䞀郚である、甚語たたは名前を衚す。

dl芁玠で䜿甚された堎合、dt芁玠自身は、その内容が定矩されおいる甚語であるこずを瀺すものではないが、これはdfn芁玠を甚いお瀺すこずができる。

この䟋では、質問に察するdt芁玠ず回答に察するdd芁玠を甚いおマヌクアップされるよくある質問FAQのリストを瀺す。

<article>
 <h1>FAQ</h1>
 <dl>
  <dt>What do we want?</dt>
  <dd>Our data.</dd>
  <dt>When do we want it?</dt>
  <dd>Now.</dd>
  <dt>Where is it?</dt>
  <dd>We are not sure.</dd>
 </dl>
</article>

4.4.11 dd芁玠

Element/dd

Support in all current engines.

Firefox1+Safari4+Chrome1+
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android4+Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?
カテゎリヌ
なし。
この芁玠を䜿甚できるコンテキスト
dl芁玠の内偎でdtたたはddの埌。
dl芁玠の子であるdiv芁玠内のddたたはdt芁玠の埌。
コンテンツモデル
フロヌコンテンツ。
text/htmlにおけるタグ省略
dd芁玠が別のdd芁玠たたはdt芁玠の盎埌に存圚する堎合、たたは芪芁玠に远加のコンテンツが存圚しない堎合、dd芁玠の終了タグは省略しおもよい。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
HTMLElementを䜿甚する。

dd芁玠は、蚘述リストdl芁玠内の甚語・説明グルヌプの䞀郚である、説明、定矩、たたは倀を衚す。

dlは蟞曞のように、語圙リストを定矩するために䜿甚するこずができる。次の䟋においお、dfnずずもにdtで䞎えられる各゚ントリヌは、定矩の様々な郚分を瀺す、耇数のddを持぀。

<dl>
 <dt><dfn>happiness</dfn></dt>
 <dd class="pronunciation">/ˈhÊpinəs/</dd>
 <dd class="part-of-speech"><i><abbr>n.</abbr></i></dd>
 <dd>The state of being happy.</dd>
 <dd>Good fortune; success. <q>Oh <b>happiness</b>! It worked!</q></dd>
 <dt><dfn>rejoice</dfn></dt>
 <dd class="pronunciation">/rɪˈdʒɔɪs/</dd>
 <dd><i class="part-of-speech"><abbr>v.intr.</abbr></i> To be delighted oneself.</dd>
 <dd><i class="part-of-speech"><abbr>v.tr.</abbr></i> To cause one to be delighted.</dd>
</dl>

4.4.12 figure芁玠

Element/figure

Support in all current engines.

Firefox4+Safari5.1+Chrome8+
Opera11+Edge79+
Edge (Legacy)12+Internet Explorer9+
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android11+
カテゎリヌ
フロヌコンテンツ。
パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
コンテンツモデル
いずれか1぀のfigcaption芁玠の埌に続くフロヌコンテンツ。
たたはフロヌコンテンツの埌に続く1぀のfigcaption芁玠。
たたはフロヌコンテンツ。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
HTMLElementを䜿甚する。

figure芁玠は、任意でキャプションをも぀完党な文のような自己完結型であり、䞀般に文曞の䞻フロヌから単独のナニットずしお参照されるフロヌコンテンツを衚す。

この文脈においお"自己完結型"は、必ずしも独立したものを意味する必芁はない。たずえば、段萜内の各文は自己完結型である。文の䞀郚である画像は、figureに䞍適切だろうが、画像で䜜られた完党な文は適切だろう。

よっおこの芁玠はむラスト、図、写真、コヌドリストなどに泚釈を付けるために䜿甚できる。

figureがキャプションでたずえば図番号でfigureを識別するこずによっお文曞の䞻芁コンテンツから参照する堎合、たずえば、文曞のフロヌに圱響を䞎えるこずなくペヌゞの暪ぞ、専甚のペヌゞぞ、たたは付録ぞなど、文曞の䞻芁コンテンツから容易に離れられるようなコンテンツを可胜にする。

たずえば、"次の図が瀺すように"たたは"䞊の写真においお"の次に図に移動するなど、figure芁玠がその盞察䜍眮によっお参照される堎合、ペヌゞの意味を混乱させるだろう。著者は、ペヌゞがペヌゞの意味に圱響を䞎えるこずなく簡単に再スタむル付けできるように、そのような盞察参照を䜿甚するよりもむしろ、図を参照するためのラベルの䜿甚を怜蚎するこずを掚奚する。

もしあれば、芁玠の子ずなる最初のfigcaption芁玠は、figure芁玠のコンテンツのキャプションを衚す。子figcaption芁玠が存圚しない堎合、キャプションは存圚しない。

figure芁玠のコンテンツは、呚囲のフロヌの䞀郚である。たずえば画像共有サむト䞊の写真など、ペヌゞの目的が数字を衚瀺するこずである堎合、figureおよびfigcaption芁玠は明瀺的にその図のキャプションを提䟛するために䜿甚できる。わずかに関連する、たたは呚囲のフロヌよりも分離する目的を提䟛するコンテンツに察しおは、aside芁玠が䜿甚されるべきであるそしおそれ自䜓にfigureを包むこずができる。たずえば、articleからのコンテンツを繰り返すリヌド文は、figureに比べ、asideがより適切であろう。リヌド文はコンテンツの䞀郚ではないので、読者を魅了するたたは重芁なトピックを匷調する目的に察しおコンテンツの繰り返しである。

この䟋は、コヌドリストをマヌクアップするためのfigure芁玠を瀺す。

<p>In <a href="#l4">listing 4</a> we see the primary core interface
API declaration.</p>
<figure id="l4">
 <figcaption>Listing 4. The primary core interface API declaration.</figcaption>
 <pre><code>interface PrimaryCore {
 boolean verifyDataLine();
 undefined sendData(sequence&lt;byte> data);
 undefined initSelfDestruct();
}</code></pre>
</figure>
<p>The API is designed to use UTF-8.</p>

これはギャラリヌ内のようなペヌゞの䞻コンテンツである写真をマヌクアップするfigure芁玠である。

<!DOCTYPE HTML>
<html lang="en">
<title>Bubbles at work — My Gallery™</title>
<figure>
 <img src="bubbles-work.jpeg"
      alt="Bubbles, sitting in his office chair, works on his
           latest project intently.">
 <figcaption>Bubbles at work</figcaption>
</figure>
<nav><a href="19414.html">Prev</a> — <a href="19416.html">Next</a></nav>

この䟋においお、figureにない画像にくわえお、figureにある画像ず動画が芋られる。自己完結型のナニットではないので、最初の画像はリテラルに䟋の第2文の䞀郚である。したがっお、figureは䞍適切であろう。

<h2>Malinko's comics</h2>

<p>This case centered on some sort of "intellectual property"
infringement related to a comic (see Exhibit A). The suit started
after a trailer ending with these words:

<blockquote>
 <img src="promblem-packed-action.png" alt="ROUGH COPY! Promblem-Packed Action!">
</blockquote>

<p>...was aired. A lawyer, armed with a Bigger Notebook, launched a
preemptive strike using snowballs. A complete copy of the trailer is
included with Exhibit B.

<figure>
 <img src="ex-a.png" alt="Two squiggles on a dirty piece of paper.">
 <figcaption>Exhibit A. The alleged <cite>rough copy</cite> comic.</figcaption>
</figure>

<figure>
 <video src="ex-b.mov"></video>
 <figcaption>Exhibit B. The <cite>Rough Copy</cite> trailer.</figcaption>
</figure>

<p>The case was resolved out of court.

ここでは、詩の䞀郚にfigureを甚いおマヌクアップしおいる。

<figure>
 <p>'Twas brillig, and the slithy toves<br>
 Did gyre and gimble in the wabe;<br>
 All mimsy were the borogoves,<br>
 And the mome raths outgrabe.</p>
 <figcaption><cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98</figcaption>
</figure>

この䟋においお、それは城を取り扱うより倧きな䜜品の䞀郚である可胜性があり、ネストされたfigure芁玠は、グルヌプ内の各図に察しおグルヌプのキャプションず個々のキャプションの䞡方を提䟛するために䜿甚される

<figure>
 <figcaption>The castle through the ages: 1423, 1858, and 1999 respectively.</figcaption>
 <figure>
  <figcaption>Etching. Anonymous, ca. 1423.</figcaption>
  <img src="castle1423.jpeg" alt="The castle has one tower, and a tall wall around it.">
 </figure>
 <figure>
  <figcaption>Oil-based paint on canvas. Maria Towle, 1858.</figcaption>
  <img src="castle1858.jpeg" alt="The castle now has two towers and two walls.">
 </figure>
 <figure>
  <figcaption>Film photograph. Peter Jankle, 1999.</figcaption>
  <img src="castle1999.jpeg" alt="The castle lies in ruins, the original tower all that remains in one piece.">
 </figure>
</figure>

前の䟋は、次のようにより簡朔に曞くこずもできるネストされたfigure/figcaptionペアの堎所でtitle属性を甚いお:

<figure>
 <img src="castle1423.jpeg" title="Etching. Anonymous, ca. 1423."
      alt="The castle has one tower, and a tall wall around it.">
 <img src="castle1858.jpeg" title="Oil-based paint on canvas. Maria Towle, 1858."
      alt="The castle now has two towers and two walls.">
 <img src="castle1999.jpeg" title="Film photograph. Peter Jankle, 1999."
      alt="The castle lies in ruins, the original tower all that remains in one piece.">
 <figcaption>The castle through the ages: 1423, 1858, and 1999 respectively.</figcaption>
</figure>

図は、時にはコンテンツからのみ、暗黙的に参照される

<article>
 <h1>Fiscal negotiations stumble in Congress as deadline nears</h1>
 <figure>
  <img src="obama-reid.jpeg" alt="Obama and Reid sit together smiling in the Oval Office.">
  <figcaption>Barack Obama and Harry Reid. White House press photograph.</figcaption>
 </figure>
 <p>Negotiations in Congress to end the fiscal impasse sputtered on Tuesday, leaving both chambers
 grasping for a way to reopen the government and raise the country's borrowing authority with a
 Thursday deadline drawing near.</p>
 ...
</article>

4.4.13 figcaption芁玠

Element/figcaption

Support in all current engines.

Firefox4+Safari5.1+Chrome8+
Opera11+Edge79+
Edge (Legacy)12+Internet Explorer9+
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android11+
カテゎリヌ
なし。
この芁玠を䜿甚できるコンテキスト
figure芁玠の最初たたは最埌の子ずしお。
コンテンツモデル
フロヌコンテンツ。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
HTMLElementを䜿甚する。

figcaption芁玠は、もしあれば、figcaption芁玠の芪figure芁玠に属する残りのコンテンツのキャプションたたは凡䟋を衚す。

芁玠は、゜ヌスに関する远加情報を含めるこずができる

<figcaption>
 <p>A duck.</p>
 <p><small>Photograph courtesy of 🌟 News.</small></p>
</figcaption>
<figcaption>
 <p>Average rent for 3-room apartments, excluding non-profit apartments</p>
 <p>ZÃŒrich’s Statistics Office — <time datetime=2017-11-14>14 November 2017</time></p>
</figcaption>

4.4.14 main芁玠

Element/main

Support in all current engines.

Firefox21+Safari7+Chrome26+
Opera16+Edge79+
Edge (Legacy)12+Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?
カテゎリヌ
フロヌコンテンツ。
パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所、ただしそのフロヌコンテンツが階局的に正しいmain芁玠である堎合に限る。
コンテンツモデル
フロヌコンテンツ。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
HTMLElementを䜿甚する。

main芁玠は、文曞の䞻芁なコンテンツを衚す。

文曞は、hidden属性が指定されないmain芁玠を耇数持っおはならない。

階局的に正しいmain芁玠は、祖先芁玠がhtml、body、div、アクセシブルな名前のないform、および自埋カスタム芁玠に限定されるものである。各main芁玠は、階局的に正しいmain芁玠でなければならない。

この䟋においお、著者は、ペヌゞの各構成芁玠がボックス内にレンダリングされるプレれンテヌションを䜿甚しおいる。ヘッダヌ、フッタヌ、ナビゲヌションバヌ、およびサむドバヌずは察照的にペヌゞの䞻芁コンテンツを包むために、main芁玠が䜿甚される。

<!DOCTYPE html>
<html lang="en">
<title>RPG System 17</title>
<style>
 header, nav, aside, main, footer {
   margin: 0.5em; border: thin solid; padding: 0.5em;
   background: #EFF; color: black; box-shadow: 0 0 0.25em #033;
 }
 h1, h2, p { margin: 0; }
 nav, main { float: left; }
 aside { float: right; }
 footer { clear: both; }
</style>
<header>
 <h1>System Eighteen</h1>
</header>
<nav>
 <a href="../16/">← System 17</a>
 <a href="../18/">RPXIX →</a>
</nav>
<aside>
 <p>This system has no HP mechanic, so there's no healing.
</aside>
<main>
 <h2>Character creation</h2>
 <p>Attributes (magic, strength, agility) are purchased at the cost of one point per level.</p>
 <h2>Rolls</h2>
 <p>Each encounter, roll the dice for all your skills. If you roll more than the opponent, you win.</p>
</main>
<footer>
 <p>Copyright © 2013
</footer>
</html>

次の䟋においお、耇数のmain芁玠が䜿甚されおおり、スクリプトは、サヌバヌのラりンドトリップを行わずにナビゲヌションを実行し、最新でないものにhidden属性を蚭定するために䜿甚される

<!doctype html>
<html lang=en-CA>
<meta charset=utf-8>
<title> 
 </title>
<link rel=stylesheet href=spa.css>
<script src=spa.js async></script>
<nav>
 <a href=/>Home</a>
 <a href=/about>About</a>
 <a href=/contact>Contact</a>
</nav>
<main>
 <h1>Home</h1>
 

</main>
<main hidden>
 <h1>About</h1>
 

</main>
<main hidden>
 <h1>Contact</h1>
 

</main>
<footer>Made with ❀ by <a href=https://example.com/>Example 👻</a>.</footer>

4.4.15 search芁玠

Element/search

No support in current engines.

FirefoxNoSafariNoChromeNo
OperaNoEdgeNo
Edge (Legacy)NoInternet ExplorerNo
Firefox Android?Safari iOS?Chrome AndroidNoWebView Android?Samsung Internet?Opera Android?
カテゎリヌ
フロヌコンテンツ。
パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
コンテンツモデル
フロヌコンテンツ。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
HTMLElementを䜿甚する。

search芁玠は、怜玢たたはフィルタリング操䜜の実行に関連する䞀連のフォヌムコントロヌルたたはその他のコンテンツを含む文曞たたはアプリケヌションの䞀郚を衚す。これは、りェブサむトもしくはアプリケヌションの怜玢、珟圚のりェブペヌゞで怜玢結果を怜玢もしくはフィルタリングする方法、 たたはグロヌバルもしくはむンタヌネット党䜓の怜玢機胜であるかもしれない。

怜玢機胜の䞀郚ずしお、"クむックサヌチ"結果ずしおのサゞェストやリンクを含めるこずはできるが、怜玢結果を衚瀺するためだけにsearch芁玠を䜿甚するこずは適切ではない。むしろ、怜玢結果の返っおきたりェブペヌゞは、そのりェブペヌゞのメむンコンテンツの䞀郚ずしお衚瀺されるこずが期埅される。

次の䟋では、著者はりェブペヌゞのheader内に怜玢フォヌムを含めおいる

<header>
  <h1><a href="/">My fancy blog</a></h1>
  ...
  <search>
    <form action="search.php">
      <label for="query">Find an article</label>
      <input id="query" name="q" type="search">
      <button type="submit">Go!</button>
    </form>
  </search>
</header>

この䟋においお、著者はりェブアプリケヌションの怜玢機胜をすべおJavaScriptで実装しおいる。 サヌバヌサむドの送信を実行するために form芁玠を䜿甚しおいないが、含たれおいるsearch芁玠は、子孫コンテンツの目的が怜玢機胜を衚すものであるずセマンティックにわかる。

<search>
  <label>
    Find and filter your query
    <input type="search" id="query">
  </label>
  <label>
    <input type="checkbox" id="exact-only">
    Exact matches only
  </label>

  <section>
    <h3>Results found:</h3>
    <ul id="results">
      <li>
        <p><a href="services/consulting">Consulting services</a></p>
        <p>
          Find out how can we help you improve your business with our integrated consultants, Bob and Bob.
        </p>
      </li>
      ...
    </ul>
    <!--
      when a query returns or filters out all results
      render the no results message here
    -->
    <output id="no-results"></output>
  </section>
</search>

次の䟋では、ペヌゞに2぀の怜玢機胜がある。1぀目は、りェブペヌゞのheaderにあり、りェブサむトのコンテンツを怜玢するためのグロヌバルメカニズムずしお機胜する。その目的は、指定されたtitle属性によっお瀺される。2぀目は、珟圚のペヌゞのコンテンツを怜玢およびフィルタリングするメカニズムを衚すために、ペヌゞのメむンコンテンツの䞀郚ずしお含たれおいる。これは、その目的を瀺す芋出しを含んでいる。

<body>
  <header>
    ...
    <search title="Website">
      ...
    </search>
  </header>
  <main>
    <h1>Hotels near your location</h1>
     <search>
       <h2>Filter results</h2>
       ...
     </search>
     <article>
      <!-- search result content -->
    </article>
  </main>
</body>

4.4.16 div芁玠

Element/div

Support in all current engines.

Firefox1+Safari1+Chrome1+
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

HTMLDivElement

Support in all current engines.

Firefox1+Safari3+Chrome1+
Opera12.1+Edge79+
Edge (Legacy)12+Internet Explorer5.5+
Firefox Android?Safari iOS1+Chrome Android?WebView Android?Samsung Internet?Opera Android12.1+
カテゎリヌ
フロヌコンテンツ。
パルパブルコンテンツ。
この芁玠を䜿甚できるコンテキスト
フロヌコンテンツが期埅される堎所。
dl芁玠の子ずしお。
option芁玠、optgroup芁玠、たたはselect芁玠の子孫ずしお。
コンテンツモデル
芁玠がdl芁玠の子である堎合1぀以䞊のdt芁玠の埌に1぀以䞊のdd芁玠が続き、必芁に応じおスクリプトサポヌト芁玠ず混圚する。
そうでなければ、芁玠がoption芁玠、optgroup芁玠、たたはselect芁玠の子孫である堎合透過的。
そうでなければフロヌコンテンツ。
text/htmlにおけるタグ省略
どちらのタグも省略䞍可。
コンテンツ属性
グロヌバル属性
アクセシビリティの考慮
著者向け。
実装者向け。
サニタむれヌション
デフォルト。
DOMむンタヌフェむス
[Exposed=Window]
interface HTMLDivElement : HTMLElement {
  [HTMLConstructor] constructor();

  // also has obsolete members
};

div芁玠は、䞀切特別な意味を持たない。この芁玠は、芁玠の子を衚す。この芁玠は、class、lang、および連続した芁玠のグルヌプに共通のセマンティックスをマヌクアップするtitle属性ずずもに䜿甚できる。dt芁玠ずdd芁玠のグルヌプを包む、dl芁玠でも䜿甚できる。

他の芁玠が適切でない堎合、著者は最埌の手段の芁玠ずしおdiv芁玠を怜蚎するこずを匷く掚奚する。div芁玠の代わりにより適切な芁玠を䜿甚するこずは、読者に察しおより良いアクセシビリティず著者に察するより容易なメンテナンス性に぀ながる。

たずえば、ブログの投皿はarticle、章にsection、ペヌゞのナビゲヌションの目的にnav、フォヌムコントロヌルのグルヌプにfieldsetを䜿甚しおマヌクアップされるだろう。

䞀方、div芁玠は、文䜓䞊の目的のため、すなわち類䌌の方法で泚釈を぀けたすべおのセクション内の耇数段萜を包むために有甚であるかもしれない。次の䟋は、別々な2぀の段萜芁玠に蚀語の蚭定を䞀床に蚭定する代わりに、䞀床に2぀の段萜の蚀語を蚭定する方法ずしお䜿甚されるdiv芁玠である

<article lang="en-US">
 <h1>My use of language and my cats</h1>
 <p>My cat's behavior hasn't changed much since her absence, except
 that she plays her new physique to the neighbors regularly, in an
 attempt to get pets.</p>
 <div lang="en-GB">
  <p>My other cat, coloured black and white, is a sweetie. He followed
  us to the pool today, walking down the pavement with us. Yesterday
  he apparently visited our neighbours. I wonder if he recognises that
  their flat is a mirror image of ours.</p>
  <p>Hm, I just noticed that in the last paragraph I used British
  English. But I'm supposed to write in American English. So I
  shouldn't say "pavement" or "flat" or "colour"...</p>
 </div>
 <p>I should say "sidewalk" and "apartment" and "color"!</p>
</article>