HTML - <h1> to <h6> Tag


Advertisements


Description

The HTML <h1> to <h6> tag is used to define headings in an HTML document. <h1> defines largest heading and <h6> defines smallest heading.

Example

<!DOCTYPE html>
<html>

   <head>
      <title>HTML <h1> to <h6> Tag</title>
   </head>

   <body>
      <h1>Around the World</h1>
      <h2>Asian Countries</h2>
      <h3>India</h3>
   </body>

</html>

This will produce the following result −

Global Attributes

This tag supports all the global attributes described in HTML Attribute Reference

Specific Attributes

The HTML <h1> to <h6> tag also supports the following additional attributes −

Attribute Value Description
align left
right
center
justify
Deprecated − Specifies the alignment of the content enclosed.

Event Attributes

This tag supports all the event attributes described in HTML Events Reference

Browser Support

Chrome Firefox IE Opera Safari Android
Yes Yes Yes Yes Yes Yes

html_tags_reference.htm

Advertisements