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 334363 of head 要素

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

このリビジョンの内容

概要

<head> 要素は HTML 文書のメタデータ群を内包する要素です。他の要素を用いて記述された、文書のタイトルや概要、前後のページ等へのリンク、スクリプトやスタイルシートの定義などを内包する事が可能です。

使用可能な場所

コンテンツカテゴリ 無し
許可された内容 {{HTMLElement("title")}} 要素(ひとつのみ)、{{HTMLElement("base")}} 要素(任意)、メタデータ要素に属する全ての要素(順不同、任意の個数)。HTML5 では {{HTMLElement("object")}} 要素は <head> 要素の子要素としての使用が認められなくなりました。
タグの省略 <head> 要素内の最初のノードがコメントでない場合、開始タグを省略可能。
head 要素に続く最初のものが空白文字やコメントでない場合、終了タグが省略可能。
許可された親要素 {{HTMLElement("html")}} 要素
標準文書 HTML 5, section 4.2.1; HTML 4.01, section 7.4.1

属性

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

{{htmlattrdef("profile")}} {{HTMLVersionInline("4")}}のみ。{{obsoleteGeneric("inline","html5")}}
1 つ以上のメタデータプロファイルの URI。値が複数の場合は半角スペースで区切ります。

DOM インターフェース

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

<html>
  <head>
    <title>Document title</title>
  </head>
</html>

注意

殆どのブラウザーは タグが省略されている場合にも <head> 要素を暗黙に生成し、補完します。但し、 例外もあります。
次のブラウザーは、head 要素のタグの省略を補完しません : Android 1.6 以下、 iPhone 3.1.3 以下 Nokia 90、 Opera 9.27 以下、 Safari 3.2.1 以下(※数値は各ブラウザーのバージョンを意味します)

ブラウザ実装状況

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}

関連情報

  • <head> 要素内で使用可能な要素 : {{HTMLElement("title")}}, {{HTMLElement("base")}}, {{HTMLElement("link")}}, {{HTMLElement("style")}}, {{HTMLElement("meta")}}, {{HTMLElement("script")}}, {{HTMLElement("noscript")}}, {{HTMLElement("command")}}
{{HTML:Element_Navigation}}

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

<h2 id="Summary" name="Summary">概要</h2>
<p><code>&lt;head&gt;</code> 要素は HTML 文書のメタデータ群を内包する要素です。他の要素を用いて記述された、文書のタイトルや概要、前後のページ等へのリンク、スクリプトやスタイルシートの定義などを内包する事が可能です。</p>
<h2 id="Usage_context" name="Usage_context">使用可能な場所</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <th><a href="/ja/docs/HTML/Content_categories" title="HTML/Content categories">コンテンツカテゴリ</a></th>
      <td>無し</td>
    </tr>
    <tr>
      <th>許可された内容</th>
      <td>{{HTMLElement("title")}} 要素(ひとつのみ)、{{HTMLElement("base")}} 要素(任意)、<a href="/ja/docs/HTML/Content_categories#Metadata_content" title="HTML/Content categories#Metadata content">メタデータ要素</a>に属する全ての要素(順不同、任意の個数)。HTML5 では {{HTMLElement("object")}} 要素は <code>&lt;head&gt;</code> 要素の子要素としての使用が認められなくなりました。</td>
    </tr>
    <tr>
      <th>タグの省略</th>
      <td><code>&lt;head&gt;</code> 要素内の最初のノードがコメントでない場合、開始タグを省略可能。<br />
        <code>head</code> 要素に続く最初のものが空白文字やコメントでない場合、終了タグが省略可能。</td>
    </tr>
    <tr>
      <th>許可された親要素</th>
      <td>{{HTMLElement("html")}} 要素</td>
    </tr>
    <tr>
      <th>標準文書</th>
      <td><a class="external" href="https://www.w3.org/TR/html5/semantics.html#the-head-element-0" title="https://www.w3.org/TR/html5/semantics.html#the-head-element-0">HTML 5, section 4.2.1</a>; <a class="external" href="https://www.w3.org/TR/html401/struct/global.html#h-7.4.1" title="https://www.w3.org/TR/html401/struct/global.html#h-7.4.1">HTML 4.01, section 7.4.1</a></td>
    </tr>
  </tbody>
</table>
<h2 id="Attributes" name="Attributes">属性</h2>
<p>他の全ての要素と同様に、この要素は<a href="/ja/docs/HTML/Global_attributes" title="HTML/Global attributes">グローバル属性</a>を持ちます。</p>
<dl>
  <dt>
    {{htmlattrdef("profile")}} {{HTMLVersionInline("4")}}のみ。{{obsoleteGeneric("inline","html5")}}</dt>
  <dd>
    1 つ以上のメタデータプロファイルの URI。値が複数の場合は半角スペースで区切ります。</dd>
</dl>
<h2 id="DOM_interface" name="DOM_interface">DOM インターフェース</h2>
<p>この要素は <a href="/ja/docs/DOM/HTMLHeadElement" title="DOM/HTMLHeadElement">HTMLHeadElement</a> インターフェースを提供します。</p>
<h2 id="Example" name="Example">例</h2>
<pre class="brush: html">
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Document title&lt;/title&gt;
  &lt;/head&gt;
&lt;/html&gt;
</pre>
<h2 id="Notes" name="Notes">注意</h2>
<p>殆どのブラウザーは タグが省略されている場合にも <code>&lt;head&gt;</code> 要素を暗黙に生成し、補完します。但し、 <a class="external" href="https://www.stevesouders.com/blog/2010/05/12/autohead-my-first-browserscope-user-test/" title="https://www.stevesouders.com/blog/2010/05/12/autohead-my-first-browserscope-user-test/">例外もあります。</a><br />
  次のブラウザーは、<code>head</code> 要素のタグの省略を補完しません : Android 1.6 以下、 iPhone 3.1.3 以下 Nokia 90、 Opera 9.27 以下、 Safari 3.2.1 以下(※数値は各ブラウザーのバージョンを意味します)</p>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザ実装状況</h2>
<p>{{CompatibilityTable}}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari (WebKit)</th>
      </tr>
      <tr>
        <td>Basic support</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>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Phone</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</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><code>&lt;head&gt;</code> 要素内で使用可能な要素 : {{HTMLElement("title")}}, {{HTMLElement("base")}}, {{HTMLElement("link")}}, {{HTMLElement("style")}}, {{HTMLElement("meta")}}, {{HTMLElement("script")}}, {{HTMLElement("noscript")}}, {{HTMLElement("command")}}</li>
</ul>
<div>
  {{HTML:Element_Navigation}}</div>
このリビジョンへ戻す