hgroup

Groups a heading with secondary content such as a subtitle, alternative title, or tagline. Creates a single logical heading unit.

Usage

Use the <hgroup> element to:

  • Pair a heading with a subtitle or tagline
  • Group a heading with an alternative title
  • Associate metadata text with a heading
  • Create visually connected heading groups

The hgroup should contain one heading element (h1-h6) and one or more p or small elements for supporting text. Only the heading contributes to the document outline.

Examples

Default

Basic heading group with subtitle.

.eyebrow

Small uppercase label above the heading. Place the label <p> first in the markup.

.byline

Article metadata (author, date, reading time) with dot separators between items.

.section-header

Large section intro with a bottom border. Good for landing page sections.

.display

Hero-scale heading with fluid type and an accent rule. For landing pages and hero sections.

.display centered

Spacing variants

.tight removes the gap. .spaced increases it.

.reversed

Subtitle appears above the heading.

.divided

Divider line between heading and subtitle.

Combining variants

Multiple classes and data attributes can be combined.

Variants

Class Description
.tight No gap between elements
.spaced Generous spacing between elements
.reversed Flexbox column-reverse to show subtitle above heading
.centered Centers all text within the hgroup
data-align="center" Centers all text (attribute alternative to .centered)
.divided Adds a border between heading and subsequent content
.eyebrow Small uppercase label above heading (first p becomes the eyebrow)
.byline Article metadata with dot-separated items (author, date, reading time)
.section-header Large section intro with bottom border
.display Hero-scale fluid heading with accent rule

Accessibility

  • Only the heading (h1-h6) contributes to the document outline
  • Screen readers announce both the heading and subtitle as a group
  • The subtitle (p/small) provides context but is not treated as a separate heading
  • Use appropriate heading levels - don't skip levels for visual styling
  • Keep subtitles concise to avoid overwhelming screen reader users

Related

  • <header> - hgroup is commonly used within headers
  • <article> - Article headers often contain hgroup
  • <section> - Section introductions may use hgroup