Headings

HTML provides six heading levels from <h1> through <h6>. Headings create a hierarchy for the document. Use headings based on semantic importance rather than visual size. CSS should control visual sizing.

Heading Hierarchy
<h1>Web Development</h1>\n<h2>Frontend</h2>\n<h3>HTML</h3>\n<h3>CSS</h3>\n<h2>Backend</h2>
💡 The hierarchy communicates the relationship between major sections and subsections.
Key Takeaways
  • Use headings to represent document hierarchy.
  • Do not choose headings merely because they look visually large.
Knowledge Check

Which element represents the highest-level heading?