Tech and Media Labs
This site uses cookies to improve the user experience.




HTML5 hgroup Element

Jakob Jenkov
Last update: 2014-06-15

The HTML5 hgroup element is used to semantically group a headline and subheadline into the same header group.

Look at this example title:

<h1>Wealth</h1>
<h2>How the rich get richer, and how you can get richer too.</h2>

The h1 and h2 headline is actually part of the same title, but a browser or web crawler cannot see that. To signal that you enclose the two elements in a hgroup element, like this:

<hgroup>
<h1>Wealth</h1>
<h2>How the rich get richer, and how you can get richer too.</h2>
</hgroup>

Now the h1 and h2 elements are grouped into a single semantic headline. A web crawler will now understand that these two elements are part of the same headline.

Jakob Jenkov




Copyright  Jenkov Aps
Close TOC