by shigemk2

当面は技術的なことしか書かない

セクション

HTML5の新機能。

section 要素 - セクション - HTML要素 - HTML5 タグリファレンス - HTML5.JP

section

要素は文書またはアプリケーションの汎用的なセクションを示す
この文脈でのセクションとは、主題ごとに纏められたコンテンツ、
通常は見出しを伴う。セクションの例としては、章、タブインターフェイスの各タブ、
論文中の番号つきセクションなどがある。webサイトのホームページでも、例えば
導入部、ニュース記事、連絡先などいくつかのセクションに分割できる。

section 要素を利用することで、ウェブ制作者はどこにでも
h1 要素を使うことができるようになる。
該当ののセクションが、トップ・レベルなのか、第2レベルなのか、第3レベルなのか
どうかについて心配する必要はない。

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="description" content="テストファイル (html5)" />
    <title>テストファイル(html5)</title>
  </head>
  <body>
    <article>
      <hgroup>
	<h1>Apples</h1>
	<h2>Tasty, delicious fruit!</h2>
      </hgroup>
      <p>The apple is the pomaceous fruit of the apple tree.</p>
      <section>
	<h1>Red Delicious</h1>
	<p>These bright red apples are the most common found in many
	  supermarkets.</p>
      </section>
      <section>
	<h1>Granny Smith</h1>
	<p>These juicy, green apples make a great filling for
	  apple pies.</p>
      </section>
    </article>
  </body>
</html>

注意: ウェブ制作者は、その要素のコンテンツがシンジケーションにふさわしい場合には、section 要素ではなく article 要素を使うことが推奨される。

入門 HTML5

入門 HTML5