HTML Tag Reference - HTML tag <hgroup>








The hgroup element treats multiple header elements as a single item.

Browser compatibility

<hgroup> Yes 9.0 Yes Yes Yes

What's new in HTML5

The <hgroup> tag is new in HTML5.

Global Attributes

The <hgroup> tag supports the Global Attributes in HTML.

Event Attributes

The <hgroup> tag supports the Event Attributes in HTML.

Default CSS Settings

hgroup { 
    display: block;
}




Example

A demo showing how to use <hgroup> tag.

<!DOCTYPE HTML> 
<html> 
<head> 
<style> 
hgroup { <!--  w w  w  .j a  v  a2  s .com-->
   background: grey; 
   color: white; 
   font-size: 1em; 
   margin-top: 0px; 
} 
</style> 
</head> 
<body> 
    <hgroup> 
        <h1>H1 in group</h1> 
        <h2>H2 in group</h2> 
    </hgroup> 
    <h1>H1 outside the group</h1> 
    <h2>H2 outside the group</h2> 
    <h3>H3 outside the group</h3> 
</body> 
</html>

Click to view the demo