Introduction
Headings are like titles and subtitles in a book. They break content into meaningful sections and guide readers through the page. In HTML, headings are created using <h1> to <h6> tags.
Headings are like titles and subtitles in a book. They break content into meaningful sections and guide readers through the page. In HTML, headings are created using <h1> to <h6> tags.
What Are Heading Tags?
Heading tags define the importance of text in a webpage:
Heading tags define the importance of text in a webpage:
- <h1> is the most important heading (main title).
- <h6> is the least important heading (smallest subtitle).
Browsers display headings in decreasing size from <h1> to <h6>, but their real value is in SEO and content hierarchy, not just size.
Syntax
<h1>Main Title of the Page</h1> <h2>Section Title</h2> <h3>Subsection Title</h3>
Example
<h1>Welcome to My Website</h1> <p>This is an introduction paragraph.</p> <h2>About Us</h2> <p>Here you can learn more about our company.</p> <h3>Our Mission</h3> <p>We aim to provide quality services.</p>
Output in the browser:
- A big bold heading for "Welcome to My Website"
- A medium heading for "About Us"
- A smaller heading for "Our Mission"
Best Practices
- Use only one <h1> tag per page (usually the main page title).
- Follow a logical order (don’t jump from <h1> directly to <h4>).
- Keep headings short, clear, and descriptive.
- Headings should describe the content below them.
- Headings are important for SEO — search engines use them to understand your page structure.
Why Are Headings Important?
- They make content scannable for users.
- Improve SEO ranking by highlighting key topics.
- Add professional structure and readability to websites.
Conclusion
Heading tags are more than just big and small text — they provide structure, meaning, and hierarchy to your content. By using <h1> to <h6> wisely, you ensure your webpages are easy to read for both visitors and search engines.
Heading tags are more than just big and small text — they provide structure, meaning, and hierarchy to your content. By using <h1> to <h6> wisely, you ensure your webpages are easy to read for both visitors and search engines.
👉 In the next blog, we’ll explore the HTML Anchor Tag <a>, which is used to create links between pages.
Code Example
<h1>HTML Learning Guide</h1>
<h2>Chapter 1: Basics</h2>
<h3>What is HTML?</h3>