All TalkersCode Topics

Follow TalkersCode On Social Media

devloprr.com - A Social Media Network for developers Join Now ➔

How Many Heading Tags Are There In HTML

Last Updated : Mar 11, 2024

How Many Heading Tags Are There In HTML

In this tutorial we will show you how many heading tags are there in HTML, in HTML, you are able to make heading by using any tag and by writing text in this with the help of CSS. But, by default heading tags are already provided by HTML.

There are six heading tags given by HTML. All the heading tags have some difference in them. By default, they are six only.

Step By Step Guide On How Many Heading Tags Are There In HTML :-

As, there are six types of headings in html and they are all different. So, there representation is also different.

They are h1, h2, h3, h4, h5 and h6. All are paired tags and the text written in between them automatically occupies its properties without any additional CSS.

The difference is that all the headings are different from one other by their size. As you gone down from h1 to h6, the size automatically gets decreases.

Here, in next code we will show you an example so that you properly understand what they are.

<!DOCTYPE html>
      <html>
        <head>
          <title> Title of the document<title>
        </head>
          <body>
		<h1>
			This is first heading.
		</h1>
		<h2>
			This is second heading.
		</h2>
		<h3>
			This is third heading.
		</h3>
		<h4>
			This is fourth heading.
		</h4>
		<h5>
			This is fifth heading.
		</h5>
		<h6>
			This is sixth heading.
		</h6>
          </body>
      </html>
  1. First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
  2. Secondly, the <html> tag is used to indicate the beginning of an HTML document.
  3. As above now <head> tag is used to contain information about web page. In this tag a <title> tag is used which helps us to specify a webpage title. Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
  4. Thirdly, <body> tag is used to define the webpage body. All the contents to show on website are written here.
  5. In the body tag, we create six heading tags and as we know they all are different. So, we create six different heading tags with sequence h1, h2, h3, h4, h5 and h6.
  6. All are paired tags and also as we know we not able to see tags in webpage. So, we write like first in h1, second in h2 and so on, to show you which tag contains which one text.
  7. Now, when you open this html file in your browser, you will see that the size of fonts automatically decreases. As we previously say that the size decrease from h1 to h6.
  8. At last, the <body> and <html> tags are closed with </body> and </html> respectively.

Conclusion :-

In conclusion, here we can say that the headings tag is mostly used in html rather than to change font size and its style.

You can use any heading tag anywhere in body and according to font size which you required there.

In next sessions, we will also show you that how you able to customize you’re heading tags to make a creative and eye-catching website.

I hope this tutorial on how many heading tags are there in HTML helps you and the steps and method mentioned above are easy to follow and implement.

Author Image About Dikshita

Passionate Electronics and Communication Engineering student with expertise in web development (HTML, CSS, JS,PHP, Bootstrap, React.js) and content writing. Eager problem solver and tech enthusiast, adept at creating engaging web experiences.

Follow Dikshita On Linkedin 🡪