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 Headingh2– Subheadingh3– Section Headingh4– Subsection Headingh5– Smaller Headingh6– 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
h1tag 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
| Tag | Importance Level | Common Usage |
|---|---|---|
| h1 | Highest | Main page title |
| h2 | High | Major sections |
| h3 | Medium | Subsections |
| h4–h6 | Lower | Minor subsections |
Common Mistakes Beginners Make
- Using multiple
h1tags 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
