How Many Heading Tags Are There In HTML
Last Updated : Jul 1, 2023
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>
- First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
- Secondly, the <html> tag is used to indicate the beginning of an HTML document.
- 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.
- Thirdly, <body> tag is used to define the webpage body. All the contents to show on website are written here.
- 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.
- 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.
- 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.
- At last, the <body> and <html> tags are closed with </body> and </html> respectively.
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.