Mark up an article semantically

Task

Take an article with a title, an intro, and two sections, and mark it up using semantic HTML5 elements.

Requirements

  • The article is wrapped in <article>
  • The article title and date are placed inside a <header>
  • Each part of the article is its own <section> with its own <h2>
  • Heading hierarchy is correct (h1 for the article title, h2 for sections)

Starter code

<article>
</article>
▶ Open in HTML Editor

Hints

  • A header inside article is the heading area for that article, not for the whole site.
  • Don't skip heading levels — h1 should be followed by h2, not h3.
Show solution
<article>
  <header>
    <h1>How HTML is structured</h1>
    <p>Published March 12, 2026</p>
  </header>
  <section>
    <h2>What is a tag</h2>
    <p>A tag is the basic unit of HTML markup.</p>
  </section>
  <section>
    <h2>What is an attribute</h2>
    <p>An attribute adds extra information or behavior to a tag.</p>
  </section>
</article>

Related tools