Section (HTML element)
In HTML5, the section element represents a unit of content within a document, typically with a heading.
Contents
Semantic element
section is a container for holding further content.
It has semantic meaning: "Contents are a section of content. This element part of a larger page structure. This element may contain sub-structures."
The section element represents a generic section of a document or application.
- A section, in this context, is a thematic grouping of content.
- The theme of each section should be identified, typically by including a heading (h1-h6 element) as a child of the section element.
Examples of sections would be:
- Chapters
- The various tabbed pages in a tabbed dialog box
- The numbered sections of a thesis
A Web site's home page could be split into sections for an introduction, news items, and contact information.
Authors are encouraged to use the article element instead of the section element when it would make sense to syndicate the contents of the element.
Section is not a generic container element
The section element is not a generic container element.
When an element is needed only for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead.
A general rule is that the section element is appropriate only if the element's contents would be listed explicitly in the document's outline.
See also
External links
- section @ developer.mozilla.org
- Using sections and outlines @ developer.mozilla.org
- section @ w3schools.org