Skip to content
techsnow

Semantic HTML

Article vs Section

These two are the most confusing semantic tags. A simple rule:

  • `<article>`: could it be shared on its own and still make sense? (A blog post, a news story, a comment.) Use <article>.
  • `<section>`: is it one part of a bigger whole, with its own heading? ("Features", "Pricing", "FAQ".) Use <section>.
<main>
  <section>
    <h2>Latest posts</h2>
    <article>
      <h3>How I learned HTML in a month</h3>
      <p>...</p>
    </article>
    <article>
      <h3>10 CSS tips</h3>
      <p>...</p>
    </article>
  </section>
</main>