HTML HEADINGS


  • HTML Headings usually contain a title or a main topic of a certain content.
  • HTML Headings are block-level elements.

Example:

<html>

    <head>

          <title>Headings</title>

    </head>

         <body>

              <h1> Heading 1 </h1>

              <h2> Heading 2 </h2>

              <h3> Heading 3 </h3>

              <h4> Heading 4 </h4>

              <h5> Heading 5 </h5>

              <h6> Heading 6 </h6>

         </body>

</html>

Output:

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5

Heading 6

As you can see on the example given above the elements used are the <h1>, <h2>, <h3>, <h4> <h5> and <h6>.

You should have noticed that the size of a heading depends on its corresponding number after the h. And the lower the number the larger the font-size:

Note! You can only use tags from <h1> to <h6>