DEV Community

Cover image for HTML tag | section
Carlos Espada
Carlos Espada

Posted on • Updated on

HTML tag | section

It is used to define a section in a document when there is no other more specific semantic element to represent it.

Typically, although not required, it usually has a header (<h1>-<h6>) that is used to identify each <section> in the document.

If its content can make sense in isolation, outside of the document, it is more appropriate to use an <article>.

It should not be used as a generic container, for that the <div> already exists. The <section> should be used only for those blocks that we want to appear in the outline of the document.

It has an implicit ARIA role region only if it has an accessible name assigned with aria-labelledby, aria-label or title, in that order. Otherwise, it has no role.

  • Type: block
  • Self-closing: No
  • Semantic value: Yes

Definition and example | Support

Top comments (0)