Welcome to HTML5-Tutorials

Our site offers a lot of HTML5 learning from absolutely beginning to advanced level.If you want to make a website with HTML,this site will completely guide you a lot.So learn HTML5 syntax and form of coding easily with this website.If you have any doubt,leave a message on us.We will return you so soon.This site includes innumerable number of references you need to do after studying their corresponding elements.

In this page,we will learn about HTML <h1>-<h6> tag.

Use of <h1>-<h6> tag

The <h1>-<h6> tag is used to define the HTML heading.
Increasing order of them with respect to font size are----
<h6> < <h5> < <h4> < <h3> < <h2> < <h1>

Display:Block

Example of <h1>-<h6> tag

    <h1> This is heading1 </h1>
    <h2> This is heading2 </h2>
    <h3> This is heading3 </h3>
    <h4> This is heading4 </h4>
    <h5> This is heading5 </h5>
    <h6> This is heading6 </h6>

Supported Browsers.

Tag
<h1>-<h6> Yes Yes Yes Yes Yes

Full Code Example

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1> This is heading1 </h1>
<h2> This is heading2 </h2>
<h3> This is heading3 </h3>
<h4> This is heading4 </h4>
<h5> This is heading5 </h5>
<h6> This is heading6 </h6>
</body>
</html>

Output

This is heading1

This is heading2

This is heading3

This is heading4

This is heading5
This is heading6

Attributes of <h1>-<h6> element


Attribute Value Notes
align left
right
center
justify
It specifies alignment of heading.

Note that: The align attribute is not supported in HTML5.Use CSS instead.

More Reference


Default value of <h1> element

h1 {
display:block;
font-size:2em;
margin:0.67em 0;
font-weight:bold;
}

Default value of <h2> element

h2 {
display:block;
font-size:1.5em;
margin:0.83em 0;
font-weight:bold;
}

Default value of <h3> element

h3 {
display:block;
font-size:1.17em;
margin:1em 0;
font-weight:bold;
}

Default value of <h4> element

h4 {
display:block;
font-size:1em;
margin:1.33em 0;
font-weight:bold;
}

Default value of <h5> element

h5 {
display:block;
font-size:.83em;
margin:1.67em 0;
font-weight:bold;
}

Default value of <h6> element

h6 {
display:block;
font-size:.67em;
margin:2.33em 0;
font-weight:bold;
}