Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 392073 of p 要素

  • リビジョンの URL スラグ: Web/HTML/Element/p
  • リビジョンのタイトル: p 要素
  • リビジョンの ID: 392073
  • 作成日:
  • 作成者: ethertank
  • 現行リビジョン? いいえ
  • コメント HTML/Element/p Web/HTML/Element/p

このリビジョンの内容

概要

p 要素(<p>)は、パラグラフ(段落)を表します。

使用可能な場所

許可された内容 フレージングコンテンツ
タグの省略 後続する要素がブロックレベルであれば、終了タグを省略することが可能
許可された親要素 フローコンテンツを受け入れる全ての要素
標準文書 HTML 5, section 4.5.1; HTML 4.01, section 9.3.1

属性

他の全ての HTML 要素と同様に、この要素は グローバル属性 を持ちます。

{{ HTMLVersionInline("5") }} に於いては <p>align 属性は {{ obsolete_inline() }} となっています。
(訳注: CSS、とりわけ text-align プロパティの使用による調整が最も適切でしょう)

DOM インターフェース

この要素は HTMLParagraphElement インターフェースを提供します。

<p>This is the first paragraph of text. これは最初のテキストの段落です。 
  This is the first paragraph of text. これは最初のテキストの段落です。 </p>

<p>This is second paragraph of text. これは二番目のテキストの段落です。
   This is second paragraph of text. これは二番目のテキストの段落です。</p>

表示結果は以下の様になります。

This is the first paragraph of text. これは最初のテキストのパラグラフです。 This is the first paragraph of text. これは最初のテキストのパラグラフのです。

This is second paragraph of text. これは二番目のテキストのパラグラフです。 This is second paragraph of text. これは二番目のテキストのパラグラフです。

注意

p 要素同士の間隔を調整するには CSS の {{CSSxref('margin')}} プロパティを使用して下さい。
空の p 要素 (<p></p>) や br 要素 ({{HTMLElement('br')}}) を 二つの p 要素の間に記述してこれを実現してはなりません。これは誤りです。

関連情報

  • {{HTMLElement('hr')}} 要素
  • {{HTMLElement('br')}} 要素
{{ HTML:Element_Navigation() }}

このリビジョンのソースコード

<h2 id="Summary" name="Summary">概要</h2>
<p><strong>p 要素</strong>(&lt;p&gt;)は、パラグラフ(段落)を表します。</p>


<h2 id="Usage_context" name="Usage_context">使用可能な場所</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <th>許可された内容</th>
      <td><a href="/ja/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content categories#Phrasing content">フレージングコンテンツ</a></td>
    </tr>
    <tr>
      <th>タグの省略</th>
      <td>後続する要素がブロックレベルであれば、<span title="syntax-end-tag">終了タグ</span>を省略することが可能</td>
    </tr>
    <tr>
      <th>許可された親要素</th>
      <td><a href="/ja/docs/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">フローコンテンツ</a>を受け入れる全ての要素</td>
    </tr>
    <tr>
      <th>標準文書</th>
      <td><a class="external" href="https://www.w3.org/TR/html5/grouping-content.html#the-p-element" title="https://www.w3.org/TR/html5/grouping-content.html#the-p-element">HTML 5, section 4.5.1</a>; <a class="external" href="https://www.w3.org/TR/html401/struct/text.html#edef-P" title="https://www.w3.org/TR/html401/struct/text.html#edef-P">HTML 4.01, section 9.3.1</a></td>
    </tr>
  </tbody>
</table>



<h2 id="Attributes" name="Attributes">属性</h2>
<p>他の全ての HTML 要素と同様に、この要素は <a href="/ja/docs/HTML/Global_attributes" title="HTML/Global_attributes">グローバル属性</a> を持ちます。</p>
<p>{{ HTMLVersionInline("5") }} に於いては <code>&lt;p&gt;</code> の <strong>align</strong> 属性は {{ obsolete_inline() }} となっています。<br />
<small>(訳注: CSS、とりわけ text-align プロパティの使用による調整が最も適切でしょう)</small></p>



<h2 id="DOM_interface" name="DOM_interface">DOM インターフェース</h2>
<p>この要素は <a href="/ja/docs/DOM/HTMLParagraphElement" title="DOM/HTMLParagraphElement"><code>HTMLParagraphElement</code></a> インターフェースを提供します。</p>



<h2 id="Example" name="Example">例</h2>
<pre class="brush:html">
&lt;p&gt;This is the first paragraph of text. これは最初のテキストの段落です。 
  This is the first paragraph of text. これは最初のテキストの段落です。 &lt;/p&gt;

&lt;p&gt;This is second paragraph of text. これは二番目のテキストの段落です。
   This is second paragraph of text. これは二番目のテキストの段落です。&lt;/p&gt;
</pre>

<p>表示結果は以下の様になります。</p>
<p>This is the first paragraph of text. これは最初のテキストのパラグラフです。 This is the first paragraph of text. これは最初のテキストのパラグラフのです。</p>
<p>This is second paragraph of text. これは二番目のテキストのパラグラフです。 This is second paragraph of text. これは二番目のテキストのパラグラフです。</p>



<h2 id="Notes" name="Notes">注意</h2>
<p>p 要素同士の間隔を調整するには <a href="/ja/docs/CSS" title="CSS">CSS</a> の {{CSSxref('margin')}} プロパティを使用して下さい。<br />
  空の p 要素 (&lt;p&gt;&lt;/p&gt;) や br 要素 ({{HTMLElement('br')}}) を 二つの p 要素の間に記述してこれを実現してはなりません。これは誤りです。</p>



<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
  <li>{{HTMLElement('hr')}} 要素</li>
  <li>{{HTMLElement('br')}} 要素</li>
</ul>



<div>{{ HTML:Element_Navigation() }}</div>
このリビジョンへ戻す