Loading...
HTML Headings

HTML Headings

In this tutorial, we will learn about headings in HTML and its types with the help of examples.


Headings

  • HTML headings are important to use in any document.
  • These headings show the document structure and the users are attracted by the headings.
  • These headings help the search engines to index the structure and content of the webpage.
  • Heading tags help us to give headings to the content of a webpage.

Types of Headings

There are six different HTML headings which are defined with the <h1> tag to <h6> tag.

  • <h1> is the most important heading.
  • <h6> is the least important heading.

Browsers automatically add some space before and after a heading.
Every tag displays the heading in a different style and font size. <h1> heading should be used for the main heading of the document, followed by <h2> headings, then the less important heading <h3>, and so on.

Example :

<!DOCTYPE html>
<html>
  <head>
    <title>Document</title>
  </head>
  <body>
    <h1 title = "Heading 1">Hello World!</h1>
    <h2 title = "Heading 2">Hello World!</h2>
    <h3 title = "Heading 3">Hello World!</h3>
    <h4 title = "Heading 4">Hello World!</h4>
    <h5 title = "Heading 5">Hello World!</h5>
    <h6 title = "Heading 6">Hello World!</h6>
  </body>
</html>

Output

Hello World!

Hello World!

Hello World!

Hello World!

Hello World!
Hello World!

Next Tutorial

We hope that this tutorial helped you develop better understanding of the concept of Heading in HTML.

Keep Learning : )

In the next tutorial, you'll learn about HTML Paragraph.

- Related Topics