The <section> element represents a generic standalone section of a document when no more specific element fits. Typical uses: chapters, themed blocks, or grouped form fields that share one topic.
Give each section a heading whenever you can. Prefer <article> for self-contained posts, <nav> for major menus, <aside> for complementary notes, <main> for the page’s primary content, and <div> when you only need a styling wrapper.
Baseline · Widely available.
Not deprecated. Sectioning content support has been stable across browsers since about July 2015.
Not a styling box.
If the only reason for the wrapper is CSS or JS hooks, use <div>. Reserve <section> for thematic meaning.
Syntax
HTML Syntax
syntax.html
<section>…heading and content…</section>
Both start and end tags are required. Flow content is allowed inside. Do not place a <section> inside an <address>.
Reference
Attributes
<section> has no element-specific attributes. Use the global attributes you need most often:
Switch common section patterns and see the structure update live.
Real <section> markup. Apply a pattern to compare structures.
Preview
Introduction
A thematic group with its own heading.
Basic — one section with a clear heading.
Code
HTML Examples
Short, copy-ready snippets. Use Try It Yourself for a live editor.
Example 1 — Basic Section
One thematic block with a heading and body text.
HTML
<section id="intro" class="chapter">
<h2>Introduction</h2>
<p>
A section groups related content under one topic.
Always include a heading when you can.
</p>
</section>
A section groups related content under one topic. Always include a heading when you can.
How It Works
Open <section>. Marks one thematic group.
Add id / class when you need deep links or styles.
Put a heading first so people and assistive tech can identify the topic.
Close the tag. Both start and end tags are required.
Example 2 — Page Chapters
Split a document into several thematic sections, each with its own heading.
HTML
<h1>Choosing an Apple</h1>
<section>
<h2>Introduction</h2>
<p>A short guide to picking the right apple.</p>
</section>
<section>
<h2>Criteria</h2>
<p>Consider size, color, firmness, and sweetness.</p>
</section>
Named sections help screen-reader users scan landmarks.
How It Works
Give the heading an id (e.g. features-heading).
Set aria-labelledby on the section to that same id.
Implicit role becomes region because the section now has an accessible name.
Avoid dozens of named regions — only label sections that deserve landmarks.
Example 4 — Nested Sections
Nest a subsection when it belongs inside a larger thematic group. Keep heading levels orderly.
HTML
<section>
<h2>Getting Started</h2>
<p>Install the tools, then learn the basics.</p>
<section>
<h3>Install</h3>
<p>Download the starter kit and open the project folder.</p>
</section>
<section>
<h3>First page</h3>
<p>Create an index.html file and add a heading.</p>
</section>
</section>
If the box has no thematic meaning, use <div>. Semantics stay in HTML; layout stays in CSS.
a11y
Identify with a heading
Document sections without headings confuse outlines and SEO. Headless sections are rare (some UI toolbars).
landmarks
Nameless sections are not regions
Without an accessible name, section maps to a generic role. Name only the sections that should appear as landmarks.
address
Never inside <address>
The HTML spec forbids <section> as a descendant of <address>.
Compatibility
Browser Support
The <section> element is core HTML5 sectioning content in every major browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<section>
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera all support section as a sectioning element. With an accessible name it exposes as a region landmark.
98%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet Explorer9+
Supported
<section>Widely supported
Bottom line: Safe to use everywhere for thematic grouping. Pair each section with a heading for the best accessibility and SEO.
Remember
Key Takeaways
Role:<section> marks a thematic group when no better element fits.
Heading: identify almost every section with an h* child.
Landmark: named sections become region; unnamed ones stay generic.
One line: use <section> for themed chapters with headings — not as a generic layout box.
UA style
Default CSS Settings
Browsers treat section as a block sectioning element. A typical user-agent idea:
default.css
section {
display: block;
}
Borders, cards, and spacing come from your CSS — semantics stay in the HTML.
Frequently Asked Questions
The section element marks a generic standalone section of a document when no more specific semantic element fits — for example chapters, grouped form fields, or themed blocks that belong together under a heading.
No. section only supports the Global Attributes in HTML (such as id, class, and lang). Use a heading or aria-labelledby when you need a clear accessible name for a region landmark.
Use article when the block could stand alone or be syndicated (a blog post or news story). Use section to group related content that is part of a larger page but not necessarily reusable on its own.
section is semantic thematic grouping and should usually include a heading. div is a generic container with no meaning — prefer it for layout or styling wrappers.
Yes in almost all document cases. MDN and the HTML living standard expect sections to be identified with a heading. Headless sections are rare and mainly for certain UI toolbars.
If the section has an accessible name (for example via aria-labelledby pointing at its heading), its implicit role is region. Without a name, it is exposed as generic — so nameless sections do not clutter the landmark list.