VOOZH about

URL: https://www.geeksforgeeks.org/html/what-are-the-various-heading-elements-used-to-add-heading-in-html/

⇱ What are various heading elements used to add heading in HTML ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

What are various heading elements used to add heading in HTML ?

Last Updated : 23 Jul, 2025

An HTML heading tag is used to define the headings of a page. There are six levels of headings defined by HTML. These 6 heading elements are H1, H2, H3, H4, H5, and H6; with H1 being the highest level and H6 the least.

In this article, we will discuss various heading elements used to add a heading in HTML.

Syntax:

<h1> Contents... </h1>

Importance of Heading:

  • Search Engines use headings for indexing the structure and content of the webpage.
  • Headings are used for highlighting important topics.
  • They provide valuable information and tell us about the structure of the document.

Example 1: In this example, we will show different heading tags.

Output:

👁 Image

Example 2: This example explains the different HTML heading tags.

Output:

👁 Image

Changing the size of HTML Headings: The default size of HTML headings can be changed using the style attribute.

Example: This example explains the HTML heading tags by specifying the size of the font.

Output:

👁 Image

Horizontal rule: The <hr> tag which stands for the horizontal rule is used to define a thematic break in an HTML page. The <hr> tag is an empty tag, and it does not require an end tag. It is basically used to separate content. Please refer to the HTML <hr> tag article for further details.

Example: This example explains the HTML Headings with horizontal rules.

Output:

👁 Image

Comment
Article Tags: