Hgroup Tag in HTML5

In this article I am going to describe about the implementation and the use of hgroup tag in HTML5.
  • 1783

<hgroup> Tag

<hgroup> tag is used for defining the group of titles, subtitles, headings etc in a html document and also used to group set of <h1>-<h6> headers in a section or document. This tag is also used to group heading together.This tag is new in HTML5.

This tag is used when heading of a section or document is  having mutiple levels of sub headings. The <hgroup> tag contains only high ranking text headers <h1>-<h6> and nothing else.

For example, you might have a level 1 heading, followed by a subheading in a level 2 heading. In this instance, the level 2 heading is a subheading of the heading level 1.

Browser Support

It is supported in all major browsers.

Note: Internet Explorer 8 and earlier versions, do not support the <hgroup> tag.

Syntax

<hgroup>Header tags...</hgroup>

Example of hgroup tag in HTML5

<!DOCTYPE html>

 

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>

    <meta charset="utf-8" />

    <title>Hgroup Tag</title>

</head>

<body bgcolor="Lightblue">

    <hgroup>

        <h1>Welcome to MCN Solution</h1>

        <h2>Its an IT company</h2>

    </hgroup>

    <p>Sector 63 Noida</p>

</body>

</html>

Output

hgroup.jpg

© 2020 DotNetHeaven. All rights reserved.