Back to subject
HTML5/Semantic HTML5 Elements

Make a Semantic Page

Practical lesson

Let's replace vague containers with elements that describe the meaning of the page sections.

- <header> contains introductory or navigational content for a page or section. - <nav> groups important navigation links. - <main> contains the page's main unique content. - <section> groups a related part of a document, normally with its own heading. - <article> represents a self-contained piece of content that could stand on its own. - <aside> contains related or supporting content. - <footer> contains closing information for a page or section. - The semantic tag does not automatically create the visual design you want; its value is the meaning it gives the document. - Use the most meaningful element that fits instead of putting everything inside <div>.

Now read the page like an outline: header and navigation introduce the page, main holds the core content, sections/articles organize it, aside supports it, and footer closes it.

Try it yourself
Code

Starter example

Code
<header>
  <h1>My Site</h1>
  <nav><a href="/">Home</a> <a href="/about">About</a></nav>
</header>
<main>
  <section>
    <h2>Welcome</h2>
    <p>Hello!</p>
  </section>
</main>
<footer>Copyright 2026</footer>
Live preview