Learn HTML – Part 4 – Heading Tags (h1 to h6) Explained

Learn HTML – Part 4 – Heading Tags – h1 to h6 Explained

The HTML Heading Tags are used to define titles and subtitles on a webpage. They range from h1 to h6.

Headings help organize content and improve readability for users and search engines.


What are Heading Tags?

HTML provides six levels of headings:

  • h1 – Main Heading
  • h2 – Subheading
  • h3 – Section Heading
  • h4 – Subsection Heading
  • h5 – Smaller Heading
  • h6 – Smallest Heading

h1 is the largest and most important heading. h6 is the smallest.


Basic Syntax

<h1>Main Title</h1>
<h2>Subheading</h2>
<h3>Section Heading</h3>
<h4>Subsection</h4>
<h5>Smaller Heading</h5>
<h6>Smallest Heading</h6>

Example – Heading Levels

Main Heading (h1)

Subheading (h2)

Section Heading (h3)

Subsection (h4)

Smaller Heading (h5)
Smallest Heading (h6)

Why Are Heading Tags Important?

  • Improve content structure
  • Help search engines understand your page
  • Improve accessibility for screen readers
  • Make content easier to read

Use only one h1 tag per page for better SEO structure.


Correct Heading Structure

Headings should follow a proper hierarchy.

<h1>Website Title</h1>
   <h2>About Us</h2>
      <h3>Our Mission</h3>
   <h2>Services</h2>
      <h3>Web Development</h3>

Avoid skipping levels (for example, do not jump from h1 to h4 directly).


Quick Comparison

TagImportance LevelCommon Usage
h1HighestMain page title
h2HighMajor sections
h3MediumSubsections
h4–h6LowerMinor subsections

Common Mistakes Beginners Make

  • Using multiple h1 tags unnecessarily
  • Using headings just to increase font size
  • Skipping heading hierarchy

Conclusion

The HTML heading tags from h1 to h6 define the structure and hierarchy of content.

They are essential for SEO, readability, and accessibility.

What’s Next?

Now that you understand HTML heading tags, the next step is learning about the a tag, which is used to create links between web pages.

Next: Learn HTML – Part 5 – Anchor Tag – Creating Links in HTML →


Series: Learn HTML Series

Facebook
WhatsApp
Twitter
LinkedIn
Pinterest

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Articles from the Series

learn-html-part-63-complete-html-project-thumbnail
Learn HTML – Part 63 – Complete HTML Project (Build a Web Page)
Learn HTML – Part 63 – Complete HTML Project In this final lesson, we will build a complete HTML webpage...
learn-html-part-62-time-tag-date-time-thumbnail
Learn HTML – Part 62 – time Tag – Date & Time
Learn HTML – Part 62 – time Tag – Date & Time The HTML time tag is used to represent dates and times...
learn-html-part-61-mark-tag-highlight-text-thumbnail
Learn HTML – Part 61 – mark Tag – Highlight Text
Learn HTML – Part 61 – mark Tag – Highlight Text The HTML mark tag is used to highlight text that is...
learn-html-part-60-figcaption-tag-figure-caption-thumbnail
Learn HTML – Part 60 – figcaption Tag – Figure Caption
Learn HTML – Part 60 – figcaption Tag – Figure Caption The HTML figcaption tag is used to define a caption...
learn-html-part-59-figure-tag-media-content-thumbnail
Learn HTML – Part 59 – figure Tag – Media Content
Learn HTML – Part 59 – figure Tag – Media Content The HTML figure tag is used to group media content...
learn-html-part-58-track-tag-video-subtitles-thumbnail
Learn HTML – Part 58 – track Tag – Video Subtitles
Learn HTML – Part 58 – track Tag – Video Subtitles The HTML track tag is used to add subtitles, captions,...
learn-html-part-57-source-tag-media-sources-thumbnail
Learn HTML – Part 57 – source Tag – Media Sources
Learn HTML – Part 57 – source Tag – Media Sources The HTML source tag is used to define multiple media...
learn-html-part-56-picture-tag-responsive-images-thumbnail
Learn HTML – Part 56 – picture Tag – Responsive Images
Learn HTML – Part 56 – picture Tag – Responsive Images The HTML picture tag is used to display responsive...
learn-html-part-55-dialog-tag-modal-dialog-thumbnail
Learn HTML – Part 55 – dialog Tag – Modal Dialog
Learn HTML – Part 55 – dialog Tag – Modal Dialog The HTML dialog tag is used to create modal or popup...
learn-html-part-54-summary-tag-details-caption-thumbnail
Learn HTML – Part 54 – summary Tag – Details Caption
Learn HTML – Part 54 – summary Tag – Details Caption The HTML summary tag is used to define a visible...
Scroll to Top