[20] [DFN[[CODE(HTMLe)@en[[[hgroup]]]]]] [[要素]]は、[[見出し]]を表します。
同じく[[見出し]]を表す [CODE(HTMLe)@en[[[h[VAR[n]]]]]] [[要素]]とは違って、
[[サブタイトル]]なども含めた構造を表現できます。

* 仕様書

[REFS[
- [21] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2014-08-01 23:14:59 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#the-hgroup-element>
]REFS]

* 意味

[29] [CODE(HTMLe)@en[[[hgroup]]]] [[要素]]は、[[章]]の[RUBYB[[[見出し]]]@en[heading]]を[[表現]]します。
この[[見出し]]は、 [CODE(HTMLe)@en[[[hgroup]]]] [[要素]]の[[子供]]である
[CODE(HTMLe)@en[[[h[VAR[n]]]]]] [[要素]]すべてによって構成されます。 [SRC[>>21]]

[30] [CODE(HTMLe)@en[[[hgroup]]]] [[要素]]は、1つの[[見出し]]が[[サブタイトル]]、
別題、[[キャッチコピー]]などを含めて複数のレベルで構成される時に、
[CODE(HTMLe)@en[[[h[VAR[n]]]]]] [[要素]]をまとめるために使います。 [SRC[>>21]]

[34] [CODE(HTMLe)@en[[[hgroup]]]] [[要素]]の[[子孫]]である [CODE(HTMLe)@en[[[h[VAR[n]]]]]]
[[要素]]のうち、最大の[[階数]]のものが[[見出し]]の主たる部分を表しています。
それ以外は、[[サブタイトル]]の類を表しています [SRC[>>21]]。

* 分類

[23] [CODE(HTMLe)@en[[[hgroup]]]] [[要素]]は、次の分類に所属しています。

[FIG(short list)[
- [[フロー内容]] [SRC[>>21]]
- [[見出し内容]] [SRC[>>21]]
- [[触知可能内容]] [SRC[>>21]]
]FIG]

* 文脈

[24] [CODE(HTMLe)@en[[[hgroup]]]] [[要素]]は、[[フロー内容]]を使える場所で用いることができます
[SRC[>>21]]。

[43] [[見出し]]に主たる部分と[[サブタイトル]]部分があって、
[[CSS]] を使って両者の表示を変えたいときに有用です。

* 構文

[25] [[開始タグ]]も[[終了タグ]]も省略できません。

* 属性

[26] [[HTML]] の[[大域属性]]を利用できます。

* 内容

[22] [CODE(HTMLe)@en[[[hgroup]]]] [[要素]]の[[内容モデル]]は、1つ以上の
[CODE(HTMLe)@en[[[h[VAR[n]]]]]] [[要素]]と[[スクリプト支援要素]]とされています [SRC[>>21]]。

[42] [[見出し]]以外の[[内容]]を含められないことに注意が必要です。
そのような場合は、 [CODE(HTMLe)@en[header]] [[要素]]が適切でしょう。

* DOM インターフェイス

[27] [[要素インターフェイス]]は、 [CODE(DOMi)@en[[[HTMLElement]]]] です [SRC[>>21]]。

* 処理

[44] [[文書]]の[[アウトライン]]の検出では、 [CODE(HTMLe)@en[hgroup]] [[要素]]全体が1つの[[見出し]]扱いになり、
その[[子供]]の [CODE(HTMLe)@en[h[VAR[n]]]] [[要素]]はその一部であるという以外に[[アウトライン]]に影響しません。

[EG[
[45] [CODE(HTMLe)@en[hgroup]] 外に [CODE(HTMLe)@en[h1]] と [CODE(HTMLe)@en[h2]]
が並んでいれば、 [CODE(HTMLe)@en[h1]] で始まる[[章]]の中に
[CODE(HTMLe)@en[h2]] で始まる[[節]]が含まれていることになります。
しかし [CODE(HTMLe)@en[hgroup]] 内にあるなら、
[CODE(HTMLe)@en[hgroup]] 全体で1つの[[章]]の[[見出し]]を表すことになります。
]EG]

** 階数

[31] [CODE(HTMLe)@en[[[hgroup]]]] [[要素]]の[RUBYB[[[階数]]]@en[rank]]は、次のように定義されます
[SRC[>>21]]。
[FIG(steps)[
= [32] [[子孫]]に [CODE(HTMLe)@en[[[h[VAR[n]]]]]] [[要素]]があれば、
その最大の[[階数]]とします。
= [33] なければ、 [CODE(HTMLe)@en[[[h1]]]] [[要素]]の[[階数]]とします。
]FIG]

* 歴史

** [CODE(HTMLe)@en[header]] 要素からの改称

[28] [CODE(HTMLe)@en[[[hgroup]]]] [[要素]]は、第2次 [CODE(HTMLe)@en[[[header]]]] [[要素]]
([[HTML5]] 初期に追加されたもの) を改称する形で追加されました。

;; 改称までの歴史は [CODE(HTMLe)@en[[[header]]]] [[要素]]の項を参照してください。

** W3C の乱

[1] [CITE[Bug 11731 – Replace <hgroup> element with a <subhead> element used as the child of the <hx> element]]
( ([TIME[2011-03-03 08:06:48 +09:00]] 版))
<http://www.w3.org/Bugs/Public/show_bug.cgi?id=11731>

[2] [CITE@en[Web Applications 1.0 r6052 remove <hgroup> from the w3c spec by request of steven faulkner]]
( ([TIME[2011-05-04 04:37:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6051&to=6052>

[3] [CITE@en[Web Applications 1.0 r6064 revert change per http://lists.w3.org/Archives/Public/public-html/2011May/0061.html]]
( ([TIME[2011-05-05 05:21:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6063&to=6064>

[4] [CITE[IRC logs: freenode / #whatwg / 20110504]]
( ([TIME[2011-05-07 12:34:23 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20110504>

[5] [CITE@en[Web Applications 1.0 r7234  Let tools decide how to render <hgroup>s in ToCs and so on.]]
( ([TIME[2012-08-10 03:00:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7233&to=7234>

[6] [CITE[IRC logs: freenode / #whatwg / 20121004]]
( ([TIME[2012-10-08 21:14:21 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20121004>

[7] [CITE[IRC logs: freenode / #whatwg / 20121207]]
( ([TIME[2012-12-16 15:20:55 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20121207#l-387>

[8] [CITE@en[Web Applications 1.0 r7616     Add support for automatic sizing of headings in <hgroup> if they follow <h1>.]]
( ([TIME[2012-12-31 05:03:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7615&to=7616>

[9] [CITE@en[WG Decision on request to drop hgroup from HTML5]]
( ([[Paul Cotton]] 著, [TIME[2013-04-02 09:53:01 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-html-admin/2013Apr/0003.html>

[10] [CITE[IRC logs: freenode / #whatwg / 20130402]]
( ([TIME[2013-04-05 21:22:48 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130402#l-269>

[11] [CITE[IRC logs: freenode / #whatwg / 20130403]]
( ([TIME[2013-04-05 22:12:04 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130403>

[12] [CITE@en-US-x-Hixie[4.13 Common idioms without dedicated elements — HTML 5.1 Nightly]]
( ([TIME[2013-05-28 23:24:52 +09:00]] 版))
<http://www.w3.org/html/wg/drafts/html/master/common-idioms.html#sub-head>

[13] [CITE[IRC logs: freenode / #whatwg / 20130529]]
( ([TIME[2013-05-30 20:48:40 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130529>

[14] [CITE[IRC logs: freenode / #whatwg / 20130604]]
( ([TIME[2013-06-06 22:25:38 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130604#l-78>

[15] [CITE[IRC logs: freenode / #whatwg / 20130904]]
( ([TIME[2013-09-07 21:57:35 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130904#l-891>

[16] [CITE[IRC logs: freenode / #whatwg / 20131128]]
( ([TIME[2013-11-30 22:28:22 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20131128>

[17] [CITE[IRC logs: freenode / #whatwg / 20140117]]
( ([TIME[2014-01-18 21:23:16 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140117>

[46] [[W3C]] の主張を真に受けて [CODE(HTMLe)@en[hgroup]] [[要素]]は[[廃止]]されたなどと説明する人がいるので、
要注意です。

** [CODE(HTMLe)@en[template]] 要素への対応

[35] [CODE(HTMLe)@en[[[template]]]] [[要素]]の導入時に[[スクリプト支援要素]]が[[子供]]として使えるようになりましたが、
[CODE(HTMLe)@en[[[script]]]] [[要素]]を認める必然性はないとして、削除されました [SRC[>>18, >>19]]。
[CODE(HTMLe)@en[[[template]]]] [[要素]]はその後も認められています。

[REFS[
- [18] [CITE@en[Bug 25572 – Don't remove script elements when checking noscript (hgroup content model)]]
( ([TIME[2014-07-30 02:37:37 +09:00]] 版))
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=25572>
- [19] [CITE@en[Web Applications 1.0 r8695        Catch up with recent changes that were made while the pipeline was down. Sorry for jamming all these changes into one patch.]]
( ([TIME[2014-08-02 01:30:00 +09:00]] 版))
<http://html5.org/r/8695>
]REFS]


[36] [CITE@en[Web Applications 1.0 r8759 Add some examples of app-like usages to increase example variety]]
( ([TIME[2014-09-12 08:01:00 +09:00]] 版))
<http://html5.org/r/8759>

[37] [CITE@en[28077 – many sites, including the w3 validator, state that the hgroup element is obsolete. there is no mention of such thing here in the documentation so it is not clear whether it can be used or not.]]
([TIME[2015-08-31 12:26:58 +09:00]] 版)
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=28077>

[38] [CITE[IRC logs: freenode / #whatwg / 20150828]]
([TIME[2015-08-31 12:27:41 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20150828#l-878>

[39] [CITE@en[Add examples of <hgroup> with alternative titles]]
([[sideshowbarker]]著, [TIME[2016-07-16 04:28:20 +09:00]])
<https://github.com/whatwg/html/commit/648ae64bb6cf61487bee534df2107c33bbd9dcbe>

[40] [CITE@en[Editorial: hgroup makes multi-level heading in outline]]
([[sideshowbarker]]著, [TIME[2016-08-13 03:30:32 +09:00]])
<https://github.com/whatwg/html/commit/bd6758b8b7273ac4c025cd561178922aeff25f53>

[41] [CITE@en[Editorial: Drop mention of <hgroup> “masking” subheadings]]
([[sideshowbarker]]著, [TIME[2017-02-08 03:13:13 +09:00]])
<https://github.com/whatwg/html/commit/688809456fe566f49f9015d7c0ffe0b0cadb0317>

[FIG(quote)[
[FIGCAPTION[
[47] [CITE@ja[民泊法、来年6月施行 宙に浮く監視法案 衆院選で審議に遅れ :日本経済新聞]]
([TIME[2017-10-25 17:30:17 +09:00]])
<https://www.nikkei.com/article/DGKKZO22666030U7A021C1EE8000/>
]FIGCAPTION]

> 
> 	<div class="cmn-section cmn-indent " itemscope itemtype="http://schema.org/NewsArticle">
> 	<h1 class="cmn-article_title cmn-clearfix" itemprop="headline">
> 	<span class="cmnc-middle JSID_key_fonthln">民泊法、来年6月施行 宙に浮く監視法案</span>
> 		<span class="cmnc-small JSID_key_fonttxt">衆院選で審議に遅れ</span>
> 		<span class="cmnc-small JSID_key_fonttxt"></span>
> 		</h1>
> 

]FIG]


[48] [CITE@en[google-api-javascript-client/jsclient.html at master · google/google-api-javascript-client]]
([TIME[2018-04-17 18:10:52 +09:00]])
<https://github.com/google/google-api-javascript-client/blob/master/io-2012-slides/jsclient.html>

[49] [CITE@en[Allow <script> inside <hgroup>]]
([[annevk]]著, [TIME[2018-01-23 00:32:01 +09:00]])
<https://github.com/whatwg/html/commit/9bc8dee5ace8a8c01b9a621b4cda3377867065f1>

[50] [CITE@en['''['''c''']''' (3) Make <script> be accepted in most places <template> is now ac…]]
([[Hixie]]著, [TIME[2013-07-04 03:26:58 +09:00]])
<https://github.com/whatwg/html/commit/c9a38bd7dc5cdf19b479566a0e1ed0a57d27c6c2>

[51] [CITE@en['''['''acgiowt''']''' (2) Catch up with recent changes that were made while the p…]]
([[Hixie]]著, [TIME[2014-08-02 01:30:15 +09:00]])
<https://github.com/whatwg/html/commit/d2021df727adb22ee6d4c7e7968aa5abbd93a307>

[52] [CITE@en[Allow <script> inside <hgroup> by annevk · Pull Request #3383 · whatwg/html]]
([TIME[2018-05-01 13:34:56 +09:00]])
<https://github.com/whatwg/html/pull/3383>

[FIG(quote)[
[FIGCAPTION[
[53] [CITE@ja[天ノ岩座神宮 (あまのいわくらじんぐう) - 神社巡りジャパン]]
([[https://jinjamegurijapan.jp]]著, [TIME[2018-05-12 12:30:56 +09:00]])
<https://jinjamegurijapan.jp/detail.php?id=704>
]FIGCAPTION]

> 
> 		<div class="title-summary">
> 			<h2>天ノ岩座神宮</h2>
> 				<h3>(あまのいわくらじんぐう)</h3>
> 				
> 				<blockquote>

]FIG]


[FIG(quote)[
[FIGCAPTION[
[54] 
[CITE@ja[世帯と人口(年齢別) - データセット - 東京都オープンデータカタログサイト]], [TIME[2024-04-28T12:14:21.000Z]] <https://catalog.data.metro.tokyo.lg.jp/dataset/t131202d0000000004>
]FIGCAPTION]

>
[PRE[
    <hgroup class="header-image navbar-left">
       
<a class="logo" href="https://portal.data.metro.tokyo.lg.jp"><img src="/tokyo_od_theme/images/tokyo-od-logo.png" alt="東京都オープンデータカタログサイト" title="東京都オープンデータカタログサイト" /></a>
 
    </hgroup>
]PRE]




]FIG]


