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

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

このリビジョンの内容

概要

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

属性

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

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

<div>
  <p>Any kind of content here. Such as &lt;p&gt;, &lt;table&gt;. You name it!</p>
</div> 

表示結果

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

仕様

仕様書 策定状況 コメント
{{SpecName('HTML WHATWG', 'grouping-content.html#the-div-element', '<div>')}} {{Spec2('HTML WHATWG')}}  
{{SpecName('HTML5 W3C', 'grouping-content.html#the-div-element', '<div>')}} {{Spec2('HTML5 W3C')}}  
{{SpecName('HTML4.01', 'struct/global.html#h-7.5.4', '<div>')}} {{Spec2('HTML4.01')}}  

ブラウザ実装状況

{{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}}

関連情報

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

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

<h2 id="Summary" name="Summary">概要</h2>
<p><a href="/ja/docs/Web/HTML">HTML</a> の <code>&lt;div&gt;</code> 要素 (<em>HTML Document Division Element</em>) は、何か特定のセマンティクスを表すものではない、フローコンテンツの為の汎用コンテナです。CSS によるスタイリングの用途等で、要素のグループ化が必要な場合に用います。多くの場合、 class 属性か id 属性、lang 属性等と共に使われます。セマンティクス上で({{HTMLElement("article")}} 、{{HTMLElement("nav")}}) など他に適切な要素がある場合はそちらを使用して下さい。</p>
<ul class="htmlelt">
  <li><dfn><a href="/ja/docs/Web/HTML/Content_categories">コンテンツカテゴリ</a></dfn> <a href="/ja/docs/Web/HTML/Content_categories#Flow_content">フローコンテンツ</a>、パルパブルコンテンツ</li>
  <li><dfn>許可された内容</dfn> <a href="/ja/docs/Web/HTML/Content_categories#Flow_content">フローコンテンツ</a></li>
  <li><dfn>タグの省略</dfn> {{no_tag_omission}}</li>
  <li><dfn>許可された親要素</dfn> <a href="/ja/docs/Web/HTML/Content_categories#Flow_content">フローコンテンツ</a>を受け入れる全ての要素</li>
  <li><dfn>DOM インタフェース</dfn> {{domxref("HTMLDivElement")}}</li>
</ul>
<h2 id="Attributes" name="Attributes">属性</h2>
<p>他の全ての要素と同様に、この要素は<a href="/ja/docs/Web/HTML/Global_attributes">グローバル属性</a>を持ちます。</p>
<p>{{HTMLVersionInline("5")}} では、 <code>&lt;div&gt;</code> の <strong>align 属性</strong> は {{obsolete_inline}} となっています。</p>
<h2 id="Examples" name="Examples">例</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>
<h3 id="Result" name="Result">表示結果</h3>
<p>Any kind of content here. Such as &lt;p&gt;, &lt;table&gt;. You name it!</p>
<h2 id="Specifications" name="Specifications">仕様</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">仕様書</th>
      <th scope="col">策定状況</th>
      <th scope="col">コメント</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{SpecName('HTML WHATWG', 'grouping-content.html#the-div-element', '&lt;div&gt;')}}</td>
      <td>{{Spec2('HTML WHATWG')}}</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>{{SpecName('HTML5 W3C', 'grouping-content.html#the-div-element', '&lt;div&gt;')}}</td>
      <td>{{Spec2('HTML5 W3C')}}</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>{{SpecName('HTML4.01', 'struct/global.html#h-7.5.4', '&lt;div&gt;')}}</td>
      <td>{{Spec2('HTML4.01')}}</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザ実装状況</h2>
<div>
  {{CompatibilityTable}}</div>
<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>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
  <li>セマンティックセクショニング要素 : {{HTMLElement("section")}} 、 {{HTMLElement("article")}} 、 {{HTMLElement("nav")}} 、 {{HTMLElement("header")}} 、 {{HTMLElement("footer")}}</li>
  <li>{{HTMLElement("span")}} 要素</li>
</ul>
<div>
  {{HTML:Element_Navigation}}</div>
このリビジョンへ戻す