Heading Elements and HTML5 Semantic Comments

Heading Elements and HTML5 Semantic Comments

Headings structure content, and semantic comments improve code clarity.

Headings

HTML provides six heading levels: <h1> (most important) to <h6>.

HTML
<h1>Main Heading</h1> <h2>Subheading</h2>

Semantic Comments

HTML5 semantic elements like <header> and comments clarify structure.

HTML
<!-- Main content section --> <header> <h1>Welcome</h1> </header>

Your Task

Create a webpage with:

  1. A <header> with an <h1> and a comment
  2. An <h2> for a subsection
  3. A paragraph below the <h2>
AI Learning Assistant

Live Preview