The <hgroup>
HTML element represents a heading and related content. It groups a single <h1>–<h6>
element with one or more <p>
.
<hgroup>: The Heading Group element
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Try it
Attributes
This element only includes the global attributes.
Usage notes
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>
.
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
<!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
Technical summary
Content categories | Flow content, heading content, palpable content. |
---|---|
Permitted content | Zero or more <p> elements, followed by one h1, h2, h3, h4, h5, or h6 element, followed by zero or more <p> elements. |
Tag omission | None, both the starting and ending tag are mandatory. |
Permitted parents | Any element that accepts flow content. |
Implicit ARIA role | group |
Permitted ARIA roles | Any |
DOM interface | HTMLElement |
Specifications
Specification |
---|
HTML Standard # the-hgroup-element |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | ||
hgroup |
5 | 12 | 4 | 11.1 | 5 | 18 | 4 | 11.1 | 4.2 | 1.0 | 2.2 |
See also
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hgroup