DEV Community

Cover image for HTML tags | main
Carlos Espada
Carlos Espada

Posted on • Updated on

HTML tags | main

It is used to indicate the main content of a document. There can only be one per document (unless it has the hidden attribute) and it cannot descend from an <article>, <aside>, <footer>, <header> or <nav>.

Its content must be unique, it must not include elements that are repeated in other documents such as sidebars, links to navigate, copyright information, site logos, search forms ...

It does not contribute to the outline of the document, so it is purely informative.

It has an implicit ARIA role main, although to maintain compatibility with older browsers the redundant formula of <main role="main"> can be used.

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

Definition and example | Support

Latest comments (0)