Description

The <hgroup> element is used to group heading elements.

The following table summarizes the usages context and the version history of this tag.

Placement:Block
Content: One or more <h1> to <h6>
Start/ End Tag:Start tag: required, End tag: required
Version:HTML 5

Tip: Do not confuse the <hgroup> element (which is a visible section of the page) with the <head> element (which contains metadata not shown to the user).

Syntax

The basic syntax of the <hgroup> tag is given with:

HTML/XHTML: <hgroup> ... </hgroup>

The example below shows the <div> tag in action.

<hgroup>
    <h1>This is a main heading</h1>
    <h2>This is sub-heading</h2>
</hgroup>                          

The <hgroup> element can be placed anywhere inside the <body> but it must not be a descendant of an <address>, <footer> or another <header> element.

Tag-Specific Attributes

The <hgroup> tag doesn't have any specific attribute.

Global Attributes

Like all other HTML tags, the <hgroup> tag supports the global attributes in HTML5.

Event Attributes

The <hgroup> tag also supports the event attributes in HTML5.

Browser Compatibility

Element
<hgroup>YesYesYesYesYes