HTML5
How to Define an HTML Heading in HTML5?
Headings define the structure and hierarchy of a document. HTML provides six heading levels, from <h1> (most important) to <h6> (least important). Using them correctly improves accessibility, SEO, and readability.
The Six Heading Levels
HTML5 offers six heading elements. <h1> represents the top-level, most important heading, and each successive level (<h2>, <h3>, and so on) represents a subsection nested under the level above it.
<h1>Learn HTML5</h1>
<h2>Semantic Elements</h2>
<h3>The header Tag</h3>
<h3>The footer Tag</h3>
<h2>Media Elements</h2>
<h3>The audio Tag</h3>Headings Convey Meaning, Not Just Size
Headings are semantic — they describe the outline of your content. Do not choose a heading level just because you want bigger or smaller text; use CSS for sizing. Screen readers and search engines rely on the heading order to understand your page.
Best Practices
- Use a single <h1> per page for the main title (best practice for clarity and SEO).
- Do not skip levels — go from <h2> to <h3>, not <h2> straight to <h4>.
- Keep headings descriptive so the document outline makes sense on its own.
- Use CSS, not heading level choice, to control font size and styling.
Think of headings like a table of contents: one <h1> for the title, <h2> for major sections, and <h3>–<h6> for nested subsections.
