<section> Tag in HTML

Quick facts

CategoryFlow content, sectioning content, palpable content
Content modelFlow content, expected to include a heading
Tag omissionNeither the start nor end tag can be omitted
Permitted parentsAny element that accepts flow content
DOM interfaceHTMLElement

Syntax

<section> <h2>Heading</h2> ... </section>

Live example

Edit the code below and watch the preview update instantly.

index.html
Preview

Attributes

AttributeDescription
—<section> has no attributes of its own — only the global attributes shared by every HTML element.

Common examples

Homepage sections, each with a heading

A landing page is often a series of sections, each starting with its own <h2>.

<main> <section> <h2>Features</h2> <p>…</p> </section> <section> <h2>Pricing</h2> <p>…</p> </section> </main>

A section that screen readers list as a region

Connect the section to its heading with aria-labelledby. It then becomes a named region that assistive technology can jump to.

<section aria-labelledby="faq-title"> <h2 id="faq-title">FAQ</h2> … </section>

Chapters inside an article

Long articles can be split into sections, one per chapter.

<article> <h1>Learning HTML</h1> <section> <h2>Chapter 1: Tags</h2> </section> <section> <h2>Chapter 2: Attributes</h2> </section> </article>

A heading for screen readers only

If a section must not show a visible title, keep a heading anyway and hide it visually with CSS. Screen readers still announce it.

<section aria-labelledby="gallery-title"> <h2 id="gallery-title" class="visually-hidden">Photo gallery</h2> … </section> <style> .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } </style>

<section> vs <article>

Both group content under a heading, and the difference is independence. An <article> is self-contained: it would still make sense if you lifted it out and published it somewhere else, like a blog post, a news story, a product card or a comment. A <section> is one thematic part of something bigger, like “Features” or “Chapter 2”, and depends on its surroundings.

They can contain each other: a page can have sections full of articles (a “Latest posts” section), and an article can be divided into sections (its chapters).

<section><article>
Stands on its ownNoYes
ExamplesFeatures, Pricing, Chapter 2Blog post, comment, product card
Needs a headingUsuallyUsually

Common mistakes to avoid

  • Using section as a styling wrapper. If you only need a box to style, use a <div>.
  • Sections without headings. A section is a titled part of a document; without a heading its purpose is unclear.
  • Wrapping every paragraph in a section. Sections should group related content, not single paragraphs.
  • Using section where <main>, <nav> or <aside> fits better. The more specific element always says more.

Accessibility & SEO tips

  • A section with an accessible name (from aria-labelledby or aria-label) is exposed as a “region” landmark; without one it’s just a group.
  • Clearly titled sections help search engines match each part of a long page to specific questions, which can lead to featured snippets.
  • A tidy outline — one <h1>, then a heading per section — makes pages easier to skim for everyone.
  • Name important sections with aria-labelledby pointing at their heading, so screen reader users hear a meaningful name when they jump between regions.

Browser support

Supported in all modern browsers, including Chrome, Edge, Firefox, Safari and their mobile versions. It was introduced with HTML5, and only very old browsers such as Internet Explorer 8 needed workarounds. Screen readers in all major browsers announce a section that has an accessible name as a “region”.

Related tags

Frequently asked questions

<section> vs <div> — what's the difference?
<section> carries semantic meaning — a thematic grouping, usually with its own heading. <div> carries none and exists purely for styling or scripting hooks.
Does every <section> need a heading?
It should, semantically — a <section> without a heading is usually a sign a <div> would be more appropriate.
Can I nest sections inside sections?
Yes. A section can contain sub-sections, usually with a lower-level heading (an <h3> inside an <h2> section), just like chapters with sub-chapters.
What is the difference between <section> and <main>?
<main> wraps the page's whole primary content and appears once per page. Sections are the thematic parts inside it, such as "Features" or "Pricing".
Does <section> help SEO?
Indirectly. Search engines don't reward the tag itself, but clearly structured sections with descriptive headings make your content easier to understand and quote.
Should I use <section> or <div> for layout columns?
Use <div>. Columns, rows and wrappers are purely for layout, which is what <div> is for. Keep <section> for meaningful, titled parts of the content.