<hgroup>...</hgroup>

HTML4 HTML5

Groups a heading element (<h1>–<h6>) along with supporting content such as subtitles, taglines, or paragraphs (<p>). Prevents subtitles from forming separate sections in document outline generation.

Both opening and closing tags are required.

Attributes: Global attributes are used, such as class, id, and style.

Example

Code:

<hgroup style="border-left: 4px solid #007bff; padding-left: 10px; margin: 10px 0;">
<h1 style="margin: 0; color: #2c3e50; font-size: 1.6em;">HTML5 Guide</h1>
<p style="margin: 5px 0 0 0; color: #666; font-style: italic;">Comprehensive course for beginners and advanced users</p>
</hgroup>

The browser will interpret this code as follows:

HTML5 Guide

Comprehensive course for beginners and advanced users