<hgroup>:标题组元素

<hgroup> HTML 元素表示标题和相关内容。它将单个 <h1>–<h6> 元素与一个或多个 <p> 组合在一起。

¥The <hgroup> HTML element represents a heading and related content. It groups a single <h1>–<h6> element with one or more <p>.

Try it

属性

¥Attributes

该元素仅包含 全局属性

¥This element only includes the global attributes.

使用说明

¥Usage notes

<hgroup> 元素允许将标题与任何辅助内容(例如副标题、替代标题或标语)分组。这些类型的内容中的每一种都表示为 <hgroup> 中的 <p> 元素。

¥The <hgroup> element allows the grouping of a heading with any secondary content, such as subheadings, an alternative title, or tagline. Each of these types of content represented as a <p> element within the <hgroup>.

<hgroup> 本身对网页的文档轮廓没有影响。相反,<hgroup> 中允许的单个标题有助于形成文档大纲。

¥The <hgroup> itself has no impact on the document outline of a web page. Rather, the single allowed heading within the <hgroup> contributes to the document outline.

示例

¥Examples

html
<!doctype html>
<title>HTML Standard</title>
<body>
  <hgroup id="document-title">
    <h1>HTML: Living Standard</h1>
    <p>Last Updated 12 July 2022</p>
  </hgroup>
  <p>Some intro to the document.</p>
  <h2>Table of contents</h2>
  <ol id="toc"></ol>
  <h2>First section</h2>
  <p>Some intro to the first section.</p>
</body>

结果

¥Result

无障碍问题

¥Accessibility concerns

<hgroup> 目前没有强大的可访问语义。元素的内容(标题和可选段落)是浏览器可访问性 API 公开的内容。

¥The <hgroup> presently has no strong accessibility semantics. The content of the element (a heading and optional paragraphs) is what is exposed by browser accessibility APIs.

技术总结

¥Technical summary

内容类别 流量内容,标题内容,可触及的内容。
允许的内容 零个或多个 <p> 元素,后跟一个 h1h2h3h4h5h6 元素,后跟零个或多个 <p> 元素。
标签遗漏 无,开始和结束标记都是强制性的。
允许的父级 任何接受 流动内容 的元素。
隐式 ARIA 角色 generic
允许的 ARIA 角色 任何
DOM 接口 HTMLElement

规范

Specification
HTML Standard
# the-hgroup-element

¥Specifications

浏览器兼容性

BCD tables only load in the browser

¥Browser compatibility

也可以看看

¥See also