Loading

KEYPOINTS

  • In HTML, the heading tags define headings or titles within a document.
  • There are six heading tags in HTML defined with <h1> to <h6>. 
  • <h1> defines the important line in heading and <h6> defines by least important in heading.

DEFINATION

An HTML heading serves as a title or subheading on a webpage, helping to organize content visually and hierarchically. Headings are defined using tags ranging from <h1> to <h6>, where <h1> is the most important and typically the largest, and <h6> is the least important and smallest. The text within these tags is displayed on the browser, with the size automatically adjusted based on the level of the heading tag used.



Example:

<!DOCTYPE html>
<html>
  <head>
  </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:

Try it Yourself:

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5

Heading 6


Why Headings are important!!

  • HTML headings are an essential part of web development. They are used to organize content on a webpage in a hierarchical manner, which helps to provide semantic meaning to the content. This structure is useful for search engines as they can understand the organization of the content on the page.
  • Headings also enhance readability by dividing the content into easy sections, allowing users to navigate the page easily. They use as the basis for styling and formatting content using CSS (Cascading Style Sheets), which enables developers to apply various font sizes, styles, colors, and spacing to headings, creating a visually appealing structure within the webpage.
  • Headings contribute to creating an outline of the document, which is useful for longer articles, blog posts, or documentation. Users can navigate through the document's outline, making it easy access to specific sections of interest.