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
HTML Editor Online
Write HTML with syntax highlighting and line numbers, see a live preview, format or minify it, and open or save .html files — all in your browser.
Semantic Elements
header, nav, main, article, footer instead of generic divs.
Rebuild a page with semantic elements
Practice exercise: turn a page built from divs into semantic HTML with header, nav, main, article, section, aside and footer.