article 要素

4.4.4 article 要素

カテゴリー
フロー・コンテンツ
セクショニング・コンテンツ
formatBlock 候補
この要素を使うことができるコンテキスト:
フロー・コンテンツが期待される場所
コンテンツ・モデル:
フロー・コンテンツ
コンテンツ属性:
グローバル属性
DOMインタフェース:
HTMLElement を使う

article 要素は、ドキュメント、ページ、アプリケーション、サイトの自己完結したものを表します。つまり、シンジケーションのように、単独で再配布でき再利用できるよう意図したものです。これはフォーラムの投稿、雑誌や新聞の記事、ブログのエントリ、ユーザーが投稿したコメント、インタラクティブなウィジットやガジェット、その他、コンテンツの独立した項目が考えられます。

article 要素がネストされる場合、内側の article 要素は、原理上は外側の article のコンテンツに関連した記事を表します。例えば、ユーザーが投稿するコメントを受け付けるサイトでのブログのエントリは、そのブログのエントリの article 要素の中にネストされた article 要素として、そのコメントを表すことができます。

article 要素に関連付けられた著者情報(address 要素を参照のこと)は、ネストされた article 要素には適用されません。

とりわけ、コンテンツをシンジケーションで再配布するために使う場合、その article 要素は、その目的という意味において、Atom における entry 要素に類似しています。[ATOM]

time 要素の pubdate 属性を使って、article 要素の発行日時を提供することができます。

この例は、article 要素を使ったブログ投稿を示しています:

<article>
 <header>
  <h1>The Very First Rule of Life</h1>
  <p><time pubdate datetime="2009-10-09T14:28-08:00"></time></p>
 </header>
 <p>If there's a microphone anywhere near you, assume it's hot and
 sending whatever you're saying to the world. Seriously.</p>
 <p>...</p>
 <footer>
  <a href="?comments=1">Show comments...</a>
 </footer>
</article>

これは同じブログ投稿ですが、いくつかのコメントが表示されています:

<article>
 <header>
  <h1>The Very First Rule of Life</h1>
  <p><time pubdate datetime="2009-10-09T14:28-08:00"></time></p>
 </header>
 <p>If there's a microphone anywhere near you, assume it's hot and
 sending whatever you're saying to the world. Seriously.</p>
 <p>...</p>
 <section>
  <h1>Comments</h1>
  <article>
   <footer>
    <p>Posted by: George Washington</p>
    <p><time pubdate datetime="2009-10-10T19:10-08:00"></time></p>
   </footer>
   <p>Yeah! Especially when talking about your lobbyist friends!</p>
  </article>
  <article>
   <footer>
    <p>Posted by: George Hammond</p>
    <p><time pubdate datetime="2009-10-10T19:15-08:00"></time></p>
   </footer>
   <p>Hey, you have the same first name as me.</p>
  </article>
 </section>
</article>

それぞれのコメントに情報(誰がいつそれを書いたのかなど)を与えるために footer 要素を使っている点に注目してください:footer 要素は、この場合のように、適切であれば、そのセクションの最初に現れることもあります。(この場合に header 要素を使っても間違いではありません。これは編集環境の設定の話と言っても良いでしょう。)


※ 原文:http://www.w3.org/TR/2011/WD-html5-20110525/sections.html#the-article-element