HTML Reference ยท Sections
The <section> element
Reference for the HTML <section> element: when a thematic section is right, section vs article vs div, the region role, headings, examples and technical details.
The <section> element represents a thematic section of a document or of an application: a group of content about one topic, which normally starts with a heading. Chapters of a long page, the tabs of a settings screen, or the "Features", "Pricing" and "FAQ" blocks of a landing page are all sections.
<section> <h2>Pricing</h2> <p>One plan, everything included.</p> </section>
Try it
Each section is named by its heading through aria-labelledby, which turns it into a region landmark that screen reader users can jump to.
Attributes
This element has no attributes of its own. It accepts the global attributes.
Usage notes
- Choose the right container.
- Give it a heading. A section without a heading is usually a sign that a
<div>would be better. Use the heading level that fits the surrounding structure. - Landmarks need names. A section is exposed as a
regionlandmark only when it has an accessible name (aria-labelledbyoraria-label). Without one it is agenericelement. Don't name every section: a few well-chosen regions are more useful than dozens. - Sections in articles, articles in sections. Both nestings are valid. A long article can be split into sections, and a section such as "Latest news" can contain several articles.
Technical summary
| Content categories | Flow content, sectioning content, palpable content |
| Permitted content | Flow content |
| Tag omission | None; both the start and end tags are required |
| Permitted parents | Any element that accepts flow content |
| Implicit ARIA role | region if it has an accessible name; otherwise generic |
| DOM interface | HTMLElement |
| Default display | block |
Browser support
Supported in every browser.
Related
<article>โ self-contained content<div>โ a generic container with no meaning<h1>โ<h6>โ the headings that introduce sections<aside>โ tangential content- Lessons: Semantic Elements, Page Layout, Headings and Paragraphs