Headings
h1 through h6 and document hierarchy
Skills taught: html.headings, html.hierarchy, html.seo-basics
HTML gives you six heading levels: **h1** is the page's main title, and **h2** through **h6** mark sub-sections in descending importance.
<h1>Web Development</h1>
<h2>Front-end</h2>
<h3>HTML</h3>
<h3>CSS</h3>
<h2>Back-end</h2>
<h3>Node.js</h3>
<h4>Express</h4>
Tip:
Never skip heading levels. Don't jump from h2 to h4 just to get a smaller visual size — use CSS for that. The hierarchy must be logical.
Warning:
Frequently Asked Questions
Does the visual size of headings matter?
No. The semantic level matters. Use CSS to change the visual appearance. An h1 can be styled to look small; that doesn't change its semantic weight.
Can I use h2 before h1?
Technically the browser won't crash, but it's invalid structure. Always place h1 first as the page's top-level heading.
Do headings help SEO?
Yes. Search engines use heading text as strong relevance signals, especially h1. Descriptive headings that match user search intent improve rankings.