<section>...</section>

HTML4 HTML5

The <section> tag represents an independent thematic section of an HTML document[cite: 3]. It groups related content forming a logical unit (e.g., article chapter, "About Us" section, related services, or news feed)[cite: 3].

Good accessibility practices (a11y) and HTML standards require that each section contains a heading (most commonly <h2> to <h6>) describing its subject[cite: 3].

Both opening and closing tags are mandatory[cite: 3].

Attributes:

Example

In the example below, the <section> container isolates a logically cohesive page segment dedicated to services offered[cite: 3]:

Code:

<section> <h2>Our Services</h2> <p>We offer comprehensive web development, graphic design, and SEO optimization.</p> </section>

The browser will interpret this code as follows:

Our Services

We offer comprehensive web development, graphic design, and SEO optimization.