---
title: "What is the difference between section, article and div?"
description: "A div is a generic box with no meaning, a section groups a themed part of a page under a heading, and an article wraps content that makes sense on its own. Here is how to choose."
url: https://www.danny.engineering/answer/html/what-is-the-difference-between-section-article-and-div
author: Danny
published: 2026-11-27T00:00:00.000Z
updated: 2026-11-27T18:57:00.000Z
tags: ["HTML"]
---

# What is the difference between section, article and div?

## The short answer


Use `article` for content that stands on its own, such as a blog post, a comment or a product card. Use `section` for a themed part of a page that has its own heading. Use `div` when you only need a box for styling or layout and the content has no extra meaning.


```html
<main>
  <article>
    <h1>Baking sourdough at home</h1>

    <section aria-labelledby="ingredients">
      <h2 id="ingredients">Ingredients</h2>
      <div class="two-column">
        <ul>...</ul>
        <img src="/flour.jpg" alt="Bags of strong white flour">
      </div>
    </section>
  </article>
</main>
```


## Why it happens


All three elements look identical by default: block boxes with no styling. The difference is meaning, and that meaning is exposed to the accessibility tree that screen readers, browser reader modes and other tools use.

- `div` has no role. Assistive technology ignores it and reads its contents as if it were not there.
- `article` has the `article` role. It tells tools that the content is a complete, independent unit.
- `section` has the `region` role, but only when it has an accessible name, for example from `aria-labelledby` pointing at its heading. A region with a name becomes a landmark that screen reader users can jump to. Without a name it behaves like a `div`.

So picking the right element is less about passing a validator and more about giving people who navigate by structure something useful to navigate with.


## How to fix it


### Use article for self-contained content


A good test: would this make sense if you lifted it out and put it in an RSS feed, a search result or another page? If yes, it is an `article`.


```html
<article class="comment">
  <h3>Sam, 3 hours ago</h3>
  <p>This worked for me, thank you.</p>
</article>
```


Blog posts, news stories, forum posts, comments and product cards in a listing all fit.


### Use section for a themed group with a heading


A `section` is part of something larger and only makes sense in context: the "Ingredients" part of a recipe, the "Pricing" part of a landing page. It should almost always start with a heading. If it is important enough to be a landmark, name it with `aria-labelledby`.


```html
<section aria-labelledby="pricing-title">
  <h2 id="pricing-title">Pricing</h2>
  ...
</section>
```


### Use div for layout and styling


Wrappers for flexbox or grid, card shells, animation hooks and anything that exists only because of CSS should be a `div`. There is nothing wrong with `div`; the problem is only using it where a meaningful element would help.


### Reach for the more specific elements first


Before choosing between these three, check whether a more specific element fits: `main` for the main content, `nav` for navigation links, `header` and `footer` for introductory and closing content, `aside` for related but separate content, and `figure` for an image or code sample with a caption.


### Nesting works both ways


An `article` can contain `section` elements (the parts of a long post), and a `section` can contain `article` elements (a "Latest posts" section holding several post cards). Choose based on what each piece is, not on where it sits.


## Common pitfalls

- Using `section` as a generic wrapper just to avoid `div`. It adds no value without a heading.
- Naming every `section`. Too many landmarks make landmark navigation noisy; name only the major parts.
- Expecting each `section` to reset heading levels. The old document outline algorithm was never implemented by browsers and has been removed from the HTML standard, so use `h2`, `h3` and so on in order.
- Wrapping the whole page in an `article`. Use `main` for that.
- Adding `role="region"` or `role="article"` to a `div` when the real element would do the same job.

## Related reading

- [MDN: the section element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/section)
- [MDN: the article element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article)
- [MDN: the div element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div)
