DEV Community

Cover image for HTML tags | main
Carlos Espada
Carlos Espada

Posted on • Edited on

2

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

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more