Welcome to the html tutorial, and here we will discuss heading tags. As the name suggests, the heading tags are used as a heading  for the important part. In Html, the heading tags include h1 to h6 tags and have different values at different level.

learn heading tags

Heading tags – Syntax

The syntax of heading tag  start with <hn> and close with </hn>, here n specify the number from 1 to 6.
<hn>   here comes content  </hn>
Now let’s see the importance of values in place of ‘n’ in <hn>.

H1 heading is the main tag, followed by h2 headings. Then comes less important h3 tag, followed by h4, h5 and h6.

Importance of Heading tags

  • Heading tags are used by the search engine to find out the important term “keyword”
  • Users will find out the importance of your content via heading or sub-heading of your content.
  • Browsers recognize heading tags where they don’t recognize style sheets.

Tips to remember

  • Try to have one h1 tag in a single page.
  • Can have more than one h2 tag in a single page.

heading tags -Example

In this example, we will use all heading tags to understand its uses, the most important is h1 tag, because it will use to highlight page title or heading with keywords. Let’s see the example first, and then we will discuss other heading tag.

<html>
<head> </head>
<body>
<h1>SharpLesson says h1</h1>
<h2>SharpLesson says h2</h2>
<h3>SharpLesson says h3</h3>
<h4>SharpLesson says h4</h4>
<h5>SharpLesson says h5</h5>
<h6>SharpLesson says h6</h6>
</body>
</html>

The result will be:

Example of heading tags

The above result show how heading tags will give you results, h3 is good for highlighting points and h4, h5 can be used as a sub heading for h3. The last tag is h6, it is less important than top three, but can be used in place of bold text.

Conclusion

We have covered how heading tags will help to create page heading,  content heading and sub-heading as per the requirement.  Remember the most important thing, never get confused with the head tag. Head tag is different than heading tags.


What next? Next we will learn P tag or paragraph tag.


If you liked our content on heading tags then share with your friends or like us. If you wish, you can link to us as well. If you have any query or suggestion then do write to us: sharplesson[at]yahoo.com