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

  • リビジョンの URL スラグ: Web/HTML/Element/div
  • リビジョンのタイトル: div 要素
  • リビジョンの ID: 939993
  • 作成日:
  • 作成者: yyss
  • 現行リビジョン? はい
  • コメント 英語版 Oct 14, 2015, 2:37:57 AM に対応。

このリビジョンの内容

概要

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

コンテンツカテゴリ フローコンテンツ、パルパブルコンテンツ
許可された内容 フローコンテンツ
タグの省略 {{no_tag_omission}}
許可された親要素 フローコンテンツを受け入れるすべての要素
DOM インターフェイス {{domxref("HTMLDivElement")}}

属性

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

{{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")}} 要素
{{HTMLRef}}

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

<h2 id="Summary" name="Summary">概要</h2>

<p><strong><a href="/ja/docs/Web/HTML">HTML</a> の <code>&lt;div&gt;</code> 要素</strong> (<em>HTML Document Division Element</em>) は、何か特定のセマンティクスを表すものではない、フローコンテンツの為の汎用コンテナです。スタイリングのためのグループ要素として (<strong>class</strong> 属性か <strong>id</strong> 属性を使用)、あるいは <strong>lang</strong> などの属性値を共有するために使われます。セマンティクス上で({{HTMLElement("article")}} 、{{HTMLElement("nav")}}) など他に適切な要素がある場合はそちらを使用して下さい。</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row"><a href="/ja/docs/Web/HTML/Content_categories" title="HTML/Content_categories">コンテンツカテゴリ</a></th>
   <td><a href="/ja/docs/Web/HTML/Content_categories#Flow_content">フローコンテンツ</a>、パルパブルコンテンツ</td>
  </tr>
  <tr>
   <th scope="row">許可された内容</th>
   <td><a href="/ja/docs/Web/HTML/Content_categories#Flow_content">フローコンテンツ</a></td>
  </tr>
  <tr>
   <th scope="row">タグの省略</th>
   <td>{{no_tag_omission}}</td>
  </tr>
  <tr>
   <th scope="row">許可された親要素</th>
   <td><a href="/ja/docs/Web/HTML/Content_categories#Flow_content">フローコンテンツ</a>を受け入れるすべての要素</td>
  </tr>
  <tr>
   <th scope="row">DOM インターフェイス</th>
   <td>{{domxref("HTMLDivElement")}}</td>
  </tr>
 </tbody>
</table>

<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>{{HTMLRef}}</div>
このリビジョンへ戻す