HTML <h1> to <h6> Tag

Advertisements


Description

The HTML <h1> to <h6> tag are 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 following result:

Around the World

Asian Countries

India

Global Attributes

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

Specific Attributes

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

AttributeValueDescription
alignleft
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

ChromeFirefoxIEOperaSafariAndroid
YesYesYesYesYesYes

html_tags_reference.htm