HTML <Main> Tag

Dec 12, 2022
2 min read
HTML main Tag


The <main> tag is used to represent the main content of the <body> of a document. It contains the primary information on the page or main functionality of an app.


    <title>Document title</title>
      <p>This is a paragraph</p>
        <li>Another article</li>


  • There must be only one <main> element in a document, although <main> elements with a hidden attributed are not included in this count.

  • The <main> element is not suitable for identifying the main content areas of subsections

  • The <main> element must not be a descendant of an <article>, <aside>, <footer>, <header> or <nav> element. <header> elements can be included within the <main> tags if it is relevant to the page’s main content. Examples include in-page navigation links or article-specific <h1> headings.

  • Both the opening and closing tags are required.

  • The content in the <main> element should be unique to the document. Do not include content that appears across a set of documents, such as sidebars, navigation, logos, or content more suitable for the footer.

  • The <main> element is not sectioning content. It does not contribute to the page’s outline, unlike the <body> or heading tags.


The main element only supports the Global Attributes.

Best Practices

  • The <main> element acts as the main landmark. It can help assistive technology, such as screen readers, identify and navigate the document’s main sections.
  • Browser reader mode functionality uses the <main> element, along with headings, to identify the main content on the page when simplifying the user’s reading experience.


Browser Support



^ To support IE 11 and lower you can add role="main" to the <main> element.


Android WebviewChrome AndroidFirefox AndroidOpera AndroidiOS SafariSamsung Internet