The <section> tag is used to define a thematic or grouped section of content within a webpage. It represents a self-contained part of a document that can have its own heading and content.
Key Points
- Semantically meaningful: describes a logical grouping of related content.
- Can contain headings (
<h1>–<h6>), paragraphs, images, and other elements. - Useful for structuring the page for accessibility and SEO.
- Not intended for styling, just semantic structure.
Example
<section>
<h2>About Us</h2>
<p>We are a company dedicated to web development.</p>
</section>
<section>
<h2>Services</h2>
<p>We provide frontend and backend development services.</p>
</section>
💡 In Short:
<section>is for grouping related content into meaningful blocks with headings, improving semantic structure, accessibility, and SEO.