HTML <hgroup> Tag

The <hgroup> element represents the heading of a section.

This element is new in HTML5 and is used to group <h1> - <h6> elements' set, when it has multiple levels such as subheadings, alternative titles, or taglines.

Learn more about HTML Headings.

Syntax

The <hgroup> element comes in pairs. The content must be written between opening (<hgroup>) and closing (</hgroup>) elements.

The <hgroup> element is always inside a <header> element.

Example

<!DOCTYPE html>
<html>
   <header>
      <hgroup>
         <h1>Welcome to W3Docs</h1>
         <h2>You can learn HTML free here.</h2>
      </hgroup>
   </header>
</html>

Result


The <hgroup> element also supports the Global Attributes.