这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。
注意: 本元素已经从HTML5(W3C)规范中删除,但是它仍旧在 WHATWG 的 HTML 版本里。大多数浏览器都部分地实现,所以它不太可能消失。 但是其轮廓算法(outline algorithm)未在任何浏览器中实现,因此 <hgroup> 语义仍旧是理论的。
HTML5 (W3C) 规范提供了如何处理副标题,小标题,可选标题和标语(Subheadings, subtitles, alternative titles and taglines)的建议。
HTML <hgroup>
Element (HTML Headings Group Element) 代表一个段的标题。它规定了在文档轮廓里(the outline of the document )的单一标题是它所属的隐式或显式部分的标题。
Its text for the outline algorithm is the text of the first HTML Heading Element of highest rank (i.e., the first <h1>
, <h2>
, <h3>
, <h4>
, <h5>
or <h6>
with the smallest number among its descendants) and the rank is the rank of this very same HTML Heading Element.
Therefore this element groups several headings, contributing only the main one to the outline of the document. It allows associating secondary titles, like subheadings, alternative titles, or even taglines, with the main heading, without polluting the outline of the document.
Content categories | Flow content, heading content, palpable content. |
---|---|
Permitted content | One or more <h1> , <h2> , <h3> , <h4> , <h5> , and/or <h6> . |
Tag omission | 不允许,开始标签和结束标签都不能省略。 |
Permitted parent elements | Any element that accepts flow content. |
DOM interface | HTMLElement |
Attributes
This element only includes the global attributes.
Examples
<hgroup> <h1>Main title</h1> <h2>Secondary title</h2> </hgroup>
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 5 | 4.0 (2.0) | 9.0 | 11.10 | 4.1 |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | 2.2 | 4.0 (2.0) | 9.0 | 11.0 | 5.0 |