Headings: h1 to h6
The six heading elements form an outline of the page, with one h1 for the page's topic and lower levels for nested subsections, never skipping levels for the sake of size.
Create a meaningful heading hierarchy rather than choosing levels by visual size.
Many screen reader users move through a page by jumping from heading to heading, the way sighted readers skim bold titles. If your headings form a clear outline, the page is easy to scan for everyone. If they are chosen for their font size, the outline turns into nonsense.
The rule
Headings are an outline: one h1, then nest down without skipping.
HTML has six heading levels, <h1> to <h6>. Level 1 is the most important, level 6 the least. Think of them as the numbered structure of a report:
<h1>Travelling in Kerala</h1>
<h2>Backwaters</h2>
<h2>Food</h2>
<h3>Breakfast</h3>
<h3>Seafood</h3>
<h2>When to visit</h2>(The indentation here only shows the outline; in a real page the headings sit among paragraphs.)
Three rules follow from the rule:
- One
h1per page, naming what the page is about. It usually matches the<title>, closely if not exactly. - Go down one level at a time. After an
h2, the next deeper heading ish3, noth4. You can jump back up any number of levels when a new section starts. - Level means rank, not size. Browsers make
h1large by default, but you can restyle any heading with CSS. If you want smaller text for a top-level section, useh2and change the size with CSS; do not reach forh5.