HTML <main> Tag


The <main> HTML tag is a structural element introduced in HTML5 to represent the main content of a document. It is used to enclose the primary content of a web page, excluding any content that is repeated across multiple pages such as headers, footers, and navigation menus. By using the <main> tag, web developers provide a clear indication to search engines and assistive technologies about the main topic or purpose of the webpage, improving the overall accessibility and search engine optimization of the site. Including the main content within this tag enhances the document's semantic structure, making it easier for both machines and humans to understand the hierarchy and organization of the page's content.


Permitted Parents
Where flow content is expected, but only if it is a hierarchically correct main element.
Flow content
Start/End Tags
Start tag: required, End tag: required


<a href="#main-content">Skip to main content</a>

<!-- navigation and header content -->

<main id="main-content">
<!-- main page content -->



Global Attributes

The <main> tag also supports the Global Attributes in HTML5

Event Attributes

The <main> tag also supports the Event Attributes in HTML5

Browser Support

The following table will show you the current browser support for the HTML <main> tag.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 30th September 2023