← 4.4.1 The body elementTable of contents4.4.3 The nav element →

4.4.2 The section element

Flow content.
Sectioning content.
formatBlock candidate.
Contexts in which this element can be used:
Where flow content is expected.
Content model:
Flow content.
Content attributes:
Global attributes
DOM interface:
Uses HTMLElement.

The section element represents a generic section of a document or application. A section, in this context, is a thematic grouping of content, typically with a heading.

Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or 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.

The section element is not a generic container element. When an element is needed 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.

In the following example, we see an article (part of a larger Web page) about apples, containing two short sections.

  <h2>Tasty, delicious fruit!</h2>
 <p>The apple is the pomaceous fruit of the apple tree.</p>
  <h1>Red Delicious</h1>
  <p>These bright red apples are the most common found in many
  <h1>Granny Smith</h1>
  <p>These juicy, green apples make a great filling for
  apple pies.</p>

Notice how the use of section means that the author can use h1 elements throughout, without having to worry about whether a particular section is at the top level, the second level, the third level, and so on.

Here is a graduation programme with two sections, one for the list of people graduating, and one for the description of the ceremony.

     >Graduation Ceremony Summer 2022</Title
       >Opening Procession</P
       >Speech by Validactorian</P
       >Speech by Class President</P
       >Presentation of Diplomas</P
       >Closing Speech by Headmaster</P
         >Molly Carpenter</Li
         >Anastasia Luccio</Li
         >Ebenezar McCoy</Li
         >Karrin Murphy</Li
         >Thomas Raith</Li
         >Susan Rodriguez</Li