HTML Headings Guide

Proper use of heading elements (h1-h6) for document structure and accessibility

h1

Main page heading, should be used once per page as the primary title

Usage: Highest level, typically for page titles

<h1>Welcome to Our Website</h1>

h2

Major section headings that fall under the main title

Usage: Second level, for main content sections

<h2>Our Services</h2>

h3

Sub-sections that belong to an h2 section

Usage: Third level, for sub-sections

<h3>Web Development</h3>

h4

Further divisions under h3 sections

Usage: Fourth level, for detailed sub-sections

<h4>Frontend Technologies</h4>

h5

Minor headings for less important divisions

Usage: Fifth level, rarely needed

<h5>React Framework</h5>

h6

Lowest-level headings for fine-grained organization

Usage: Sixth level, very rarely used

<h6>Component Lifecycle</h6>

Logical Hierarchy

Maintain a consistent, logical structure without skipping levels (e.g., Don&apos;t go from h2 to h4).

Good Example
Bad Example

Single h1 per Page

Each page should have only one h1 element representing the main content focus.

Good Example
Bad Example

Semantic Meaning

Use headings to structure content, not just for visual styling.

Good Example
Bad Example

Accessibility

Screen readers rely on proper heading structure for navigation.

Good Example
Bad Example

Article Structure

Multi-column Layout

Accessibility with ARIA

Headings Playground

Experiment with heading structures in our live editor

Heading Examples Preview

Ready-to-use examples covering proper heading hierarchy

Live Preview

Proper Heading Structure

h1. Main Title

h2. Section

h3. Subsection

h2. Another Section

Bad Practices

h3. Main Title (should be h1)

h6. Section (should be h2)

h4. Subsection (inconsistent)

All examples will be loaded into an interactive editor where you can modify and test them

Continue Learning