Computer >> Computer tutorials >  >> Programming >> HTML

How to create headings in HTML page?


HTML provides 6 tags to create headings i.e. h1, h2, h3, h4, h5 and h6. Use any of the heading tags <h1> to <h6> and every tag will give you the different size of the heading. The <h1>tag defines the most important heading and <h6> defines the least important heading.

Just keep in mind that you should use these tags inside <body>…</body> tags.

How to create headings in HTML page?

Example

You can try to run the following code to create different headings in an HTML page

<!DOCTYPE html>
<html>
   <head>
      <title>HTML Headings</title>
   </head>

   <body>
      <h1>This is heading 1</h1>
      <h2>This is heading 2</h2>
      <h3>This is heading 3</h3>
      <h4>This is heading 4</h4>
      <h5>This is heading 5</h5>
      <h6>This is heading 6</h6>
   </body>
</html>

Output

How to create headings in HTML page?