Headings Hierarchy (h1-h6)
You'll learn how HTML's six heading levels organize your content like chapters in a book, making it scannable for both readers and search engines.
The Six Levels Explained
HTML provides six heading elements: <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>. Think of them like an outline for a research paper—<h1> is your title, <h2> are major sections, <h3> are subsections within those, and so on.
The hierarchy matters. <h1> is the most important (typically used once per page for the main title), and each subsequent number (<h2> through <h6>) represents decreasing importance. You wouldn't jump from Chapter 1 directly to Section 1.2.3 without Section 1.1 first—the same logic applies here.
Why This Matters
Document Structure: Headings create a logical outline of your content. Users can scan headings to quickly understand what's on the page and navigate to relevant sections.
SEO (Search Engine Optimization): Search engines use heading hierarchy to understand your page's content and structure. Proper heading use helps search engines index your page accurately, potentially improving your search rankings.
Accessibility: Screen readers can jump between headings, allowing users with visual impairments to navigate efficiently. A clear hierarchy makes this navigation meaningful.
Common Pattern
<h1>Main Page Title</h1>
<h2>First Major Section</h2>
<h3>Subsection of First Section</h3>
<h2>Second Major Section</h2>
<h3>Subsection of Second Section</h3>
<h4>A detailed point within that subsection</h4>
Notice how heading levels don't skip—you go from <h2> to <h3>, not <h2> to <h5>.
Key Takeaway: Use heading levels in order (h1→h2→h3...) to create a clear document outline that helps users, search engines, and assistive technologies understand your content's structure.