The hgroup
element treats multiple header elements as a single item.
<hgroup> |
Yes | 9.0 | Yes | Yes | Yes |
The <hgroup> tag is new in HTML5.
The <hgroup> tag supports the Global Attributes in HTML.
The <hgroup> tag supports the Event Attributes in HTML.
hgroup { display: block; }
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>