The HTML <hgroup> tag
The HTML <hgroup> element groups a single heading (<h1>–<h6>) with related secondary content — typically a subtitle or tagline in one or more <p> elements — so they are treated as one unit.
Overview
The <hgroup> element associates a heading with related secondary content — a subtitle, tagline, or alternative title. It contains exactly one heading (<h1>–<h6>) plus one or more <p> elements for the supporting text.
Its job is to keep the document outline tidy. The heading inside still defines the section's level as usual, while the accompanying <p> is understood as part of that heading group rather than the start of a new paragraph block. So a title and its tagline read as one unit instead of two unrelated lines.
Use it specifically for the title-plus-tagline pattern — not for stacking several headings to fake a subtitle, which was the old and incorrect habit before <hgroup> settled into its current form.
Syntax
<hgroup>
<h1>CodeShack</h1>
<p>Web development references and tools</p>
</hgroup>
Example
<hgroup>
<h1>The Anchor Element</h1>
<p>Everything about the HTML <a> tag</p>
</hgroup>
Best practices
Frequently asked questions
What is the hgroup element for?
Can hgroup contain two headings?
How do I add a subtitle to a heading in HTML?
<p> subtitle in an <hgroup>, e.g. an <h1> followed by a <p> tagline.Does hgroup affect the document outline?
<p> does not start a new block or section.