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 308333 of div 要素

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

このリビジョンの内容

{{英語版章題('Summary')}}

概要

この要素は、何か特定のセマンティクスを表すものではない、フロー・コンテンツの為の汎用コンテナです。CSS によるスタイリングの用途等で、要素のグループ化が必要な場合に用います。多くの場合、 class 属性id 属性lang 属性等と共に使われます。セマンティクス上で他に適切な要素がある場合はそちらを使用して下さい。

<div> は {{ HTMLElement("span") }} 要素と非常に似た役割を持っています。{{ HTMLElement("span") }} 要素がインラインレベル要素の汎用コンテナであるのに対し、<div>ブロックレベル要素の為の汎用コンテナの役割を果たします。

{{英語版章題('Usage context')}}

使用可能な場所

コンテンツカテゴリ フローコンテンツ
許可された内容 {{ HTMLElement("style") }} 及び、フローコンテンツ
タグの省略 不可。開始タグと終了タグの両方が必要です。
許可された親要素 フローコンテンツを受け入れる全ての要素
標準文書 HTML 5, section 4.5.13; HTML 4.01, section 7.5.4
{{英語版章題('Attributes')}}

属性

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

{{ HTMLVersionInline("5") }} では、 <div>align 属性 は{{ obsolete_inline() }}となっています。

{{英語版章題('DOM interface')}}

DOM インターフェース

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

{{英語版章題('Examples')}}

<div>
  <p>Any kind of content here. Such as &lt;p&gt;, &lt;table&gt;. You name it!</p>
</div>
{{英語版章題('Result')}}

表示結果

Any kind of content here. Such as <p>, <table>. You name it!

{{英語版章題('Browser compatibility')}}

ブラウザ実装状況

{{ CompatibilityTable() }}

機能 Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
基本サポート 1.0 {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}
機能 Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
基本サポート {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}
{{英語版章題('See also')}}

関連情報

  • セマンティックなセクショニング要素: {{ HTMLElement("section") }}、 {{ HTMLElement("article") }}、 {{ HTMLElement("nav") }}、 {{ HTMLElement("header") }}、 {{ HTMLElement("footer") }}
  • {{ HTMLElement("span") }} 要素
{{HTML:Element_Navigation()}}

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

<div>{{英語版章題('Summary')}}</div>
<h2 id=".E6.A6.82.E8.A6.81">概要</h2>
<p>この要素は、何か特定のセマンティクスを表すものではない、フロー・コンテンツの為の汎用コンテナです。CSS によるスタイリングの用途等で、要素のグループ化が必要な場合に用います。多くの場合、 <strong>class 属性</strong>か <strong>id 属性</strong>、<strong>lang 属性</strong>等と共に使われます。セマンティクス上で他に適切な要素がある場合はそちらを使用して下さい。</p>
<p><code>&lt;div&gt;</code> は {{ HTMLElement("span") }} 要素と非常に似た役割を持っています。{{ HTMLElement("span") }} 要素がインラインレベル要素の汎用コンテナであるのに対し、<code>&lt;div&gt;</code> は<strong>ブロックレベル要素の為の汎用コンテナの役割</strong>を果たします。</p>




<div>{{英語版章題('Usage context')}}</div>
<h2 id=".E4.BD.BF.E7.94.A8.E5.8F.AF.E8.83.BD.E3.81.AA.E5.A0.B4.E6.89.80">使用可能な場所</h2>
<table class="standard-table">
  <tbody>
    <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>{{ HTMLElement("style") }} 及び、<a href="/ja/docs/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">フローコンテンツ</a></td>
    </tr>
    <tr>
      <th>タグの省略</th>
      <td>不可。開始タグと終了タグの両方が必要です。</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-div-element" title="https://www.w3.org/TR/html5/grouping-content.html#the-div-element">HTML 5, section 4.5.13</a>; <a class="external" href="https://www.w3.org/TR/html401/struct/global.html#h-7.5.4" title="https://www.w3.org/TR/html401/struct/global.html#h-7.5.4">HTML 4.01, section 7.5.4</a></td>
    </tr>
  </tbody>
</table>


<div>{{英語版章題('Attributes')}}</div>
<h2 id=".E5.B1.9E.E6.80.A7">属性</h2>
<p>他の全ての要素と同様に、この要素は<a href="/ja/docs/HTML/Global_attributes" title="HTML/Global attributes">グローバル属性</a>を持ちます。</p>
<p>{{ HTMLVersionInline("5") }} では、 <code>&lt;div&gt;</code> の <strong>align 属性</strong> は{{ obsolete_inline() }}となっています。</p>




<div>{{英語版章題('DOM interface')}}</div>
<h2 id="DOM_.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.BC.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9">DOM インターフェース</h2>
<p>この要素は <code><a href="/ja/docs/DOM/HTMLDivElement" title="DOM/HTMLDivElement">HTMLDivElement</a></code> インターフェースを提供します。</p>




<div>{{英語版章題('Examples')}}</div>
<h2 id=".E4.BE.8B">例</h2>
<pre class="brush:html">&lt;div&gt;
  &lt;p&gt;Any kind of content here. Such as &amp;lt;p&amp;gt;, &amp;lt;table&amp;gt;. You name it!&lt;/p&gt;
&lt;/div&gt;</pre>




<div>{{英語版章題('Result')}}</div>
<h3 id=".E8.A1.A8.E7.A4.BA.E7.B5.90.E6.9E.9C">表示結果</h3>
<div>
  <p>Any kind of content here. Such as &lt;p&gt;, &lt;table&gt;. You name it!</p>
</div>




<div>{{英語版章題('Browser compatibility')}}</div>
<h2 id=".E3.83.96.E3.83.A9.E3.82.A6.E3.82.B6.E6.AF.8E.E3.81.AE.E4.BA.92.E6.8F.9B.E6.80.A7">ブラウザ実装状況</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>機能</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari (WebKit)</th>
      </tr>
      <tr>
        <td>基本サポート</td>
        <td>1.0</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>機能</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Phone</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>基本サポート</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>




<div>{{英語版章題('See also')}}</div>
<h2 id=".E5.8F.82.E7.85.A7">関連情報</h2>
<ul>
  <li>セマンティックなセクショニング要素: {{ HTMLElement("section") }}、 {{ HTMLElement("article") }}、 {{ HTMLElement("nav") }}、 {{ HTMLElement("header") }}、 {{ HTMLElement("footer") }}</li>
  <li>{{ HTMLElement("span") }} 要素</li>
</ul>



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