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:
class, id, and style are used[cite: 3].In the example below, the <section> container isolates a logically cohesive page segment dedicated to services offered[cite: 3]:
Code:
The browser will interpret this code as follows:
We offer comprehensive web development, graphic design, and SEO optimization.