<main>
SectionsRepresents the dominant content of the body. There should be only one main element per page, and it should not be nested inside other landmarks.
Common Attributes
roleExample
<main> <h1>Welcome</h1> <p>Main content goes here.</p> </main>
About the <main> Element
The <main> HTML element belongs to the Sections category of HTML elements. Represents the dominant content of the body. There should be only one main element per page, and it should not be nested inside other landmarks. Understanding when and how to use this element is essential for building well-structured, accessible, and SEO-friendly web pages.
The <main> element requires both an opening <main> and closing </main> tag. Content placed between these tags becomes the element's children. This element is part of the current HTML Living Standard and is supported in all modern browsers including Chrome, Firefox, Safari, and Edge.
Proper use of semantic HTML elements like <main> improves document structure, helps screen readers interpret content correctly, and provides signals to search engines about the purpose of different sections of your page. This leads to better accessibility scores, improved SEO rankings, and more maintainable code.