<h1> to <h6> Tags — HTML Technical Interview Questions & Answers

Six levels of section heading.

<h1> to <h6> Tags

  • Six levels of section heading.
  • <h1> is the main page heading. HTML uses this tag so the browser (and screen readers) know what the piece is, not only how it looks.
  • Board: <h1>Student marks</h1> Put it in body. Check it in the browser. Attributes go on the opening tag.
  • Trap: five h1s for style. CSS can still style it — don’t pick a tag only because of default italics.
  • Interview: name the tag, one attribute if it has a famous one (href, src, alt, for, type), one mistake.

Technical Interview Tip: <h1>: the main page heading. Example: <h1>Student marks</h1>

Code Examples for <h1> to <h6> Tags

<h1> to <h6> Tags — working example

<h1>Page title</h1>
<h2>Section</h2>
<h3>Subsection</h3>
<p>Use one h1 per page; nest heading levels in order — do not skip for styling.</p>

<h1> to <h6> Tags — headings outline the document for readers, SEO, and assistive tech.

How to Explain <h1> to <h6> Tags to an Interviewer

What is the <h1> tag?

the main page heading <h1>Student marks</h1>

One common mistake?

five h1s for style