p 要素
4.5.1 p 要素
- カテゴリー
- フロー・コンテンツ
formatBlock候補- この要素を使うことができるコンテキスト:
- フロー・コンテンツが期待される場所
- コンテンツモデル:
- フレージング・コンテンツ
- コンテンツ属性:
- グローバル属性
- DOMインタフェース:
-
interface HTMLParagraphElement : HTMLElement {};
段落は、通常は空白行を通して隣接したブロックから物理的に分離されたテキストのブロックによって、ビジュアル・メディアで表されますが、スタイル・シートやユーザーエージェントは、異なる手段で段落改行を提供することにおいて等しく正当化されるでしょう。例えば、インラインの段落記号 (¶) です。
次の例の HTML は準拠しています:
<p>The little kitten gently seated himself on a piece of carpet. Later in his 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>
※ 原文:http://www.w3.org/TR/2011/WD-html5-20110525/grouping-content.html#the-p-element