How to create headings in HTML

What is HTML Heading?

HTML headings are HTML text elements that define headline/title or sub-headline/sub-title of a document or a section in a webpage.

Headings are defined using the <h1> ,<h2> , <h3> , <h4> , <h5> and <h6> HTML tags.

These tags create hierarchical structure, with <h1> being the highest level (most important) and <h6> being the lowest.

Example of Creating HTML Heading

Any heading tag (<h1> ,<h2> , <h3> , <h4> , <h5> and <h6>) can be used to create a heading in a webpage.

In the following example <h1> heading tag is used to create a heading. It is the largest heading tag.

The text is placed between the <h1> and </h1> tags as shown in the following example.

Example of h1 Heading


Output of the above example

Examples of h1 Headings


This is an example of h1 heading


You can create different text headings with different font size using <h1> ,<h2> , <h3> , <h4> , <h5> and <h6> heading tags.

In the following example, all headings are shown:

Example of h1, h2, h3, h4, h5, h6 Headings


Output of the above example

Examples of Headings


This is an example of h1 heading

This is an example of h2 heading

This is an example of h3 heading

This is an example of h4 heading

This is an example of h5 heading
This is an example of h6 heading

Live Code Playground

In the following HTML code editor, you can practice the above code by updating or adding new HTML code. Click on the 'Run Code' button to render the code; the rendered page will be displayed in the following HTML Code Output frame. Practice until you become comfortable and proficient with your code.

HTML logo HTML Online Editor
HTML Code Output