HTML <hgroup> Tag

HTMLWeb DevelopmentFront End Technology

The <hgroup> tag defines the heading of an HTML document. It is used to group the <h1>-<h6> headings.

Note − The <hgroup> tag introduced and deprecated in HTML5. It is dropped from W3C HTML5 specification.

Following is the syntax −

<hgroup>
<h1></h1>
<h2></h2>
<h3></h3>
<h4></h4>
<h5></h5>
<h6></h6>
</hgroup>

Let us now see an example to implement the <hgroup> element in HTML −

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<title>Document Title</title>
</head>
<body>
<hgroup>
   <h1>Demo Heading One</h1>
   <h2>Demo Heading Two</h2>
<hgroup>
   <p>This is demo text.</p>
   <p>This is demo text.</p>
   <p>This is demo text.</p>
   <p>This is demo text.</p>
</body>
</html>

Output

In the above example, we have set the two headings the <hgroup> −

<hgroup>
<h1>Demo Heading One</h1>
<h2>Demo Heading Two</h2>
<hgroup>
raja
Published on 18-Jun-2019 11:24:59
Advertisements