HTML Structures: H1, H2, H3, H4, H5, H6

Photo by Growtika on Unsplash

Headers (H1–H6)
In HTML, headers are used to define the hierarchical structure of a webpage's content. These elements help both users and search engines understand the importance and organization of the information presented.

H1 – The Most Important Header

  • Purpose: Represents the main heading of the page.
  • Usage: There should typically only be one H1 on a page, summarizing the primary topic or purpose

H2 – Second Level Header

  • Purpose: Used for major sections under the main topic introduced by H1.
  • Usage: There can be multiple H2 headers, often representing subtopics or sections.

H2 – Second Level Header

  • Purpose: Used for major sections under the main topic introduced by H1.
  • Usage: There can be multiple H2 headers, often representing subtopics or sections.

H3 – Third Level Header

  • Purpose: Subsections under H2 headers, providing further detail or segmentation.
  • Usage: Used to introduce more specific content related to an H2 section.

H4 – Fourth Level Header

  • Purpose: Details within a subsection introduced by H3.
  • Usage: Helpful for organizing smaller bits of related information.

H5 – Fifth Level Header

  • Purpose: Rarely used but applicable for content that requires further division under an H4.

H6 – The Least Important Header

  • Purpose: The smallest level of header for minor details within an H5.
  • Usage: Used sparingly; more appropriate for fine-grained categorization.
By following the hierarchy of H1 to H6, you ensure that your webpage is well-organized and user-friendly.

Here is an example below:


This is the result when opened in browser.






Comments