HTML Main Tag

In HTML, the <main> tag is used to represent the main or dominant content of the document.

  • The <main> tag is newly introduced in HTML5.

  • This tag is usually written inside <body> tag.

  • The content of the <main> tag is directly related to the central topic of the document.

  • The content of the <main> tag should be unique and there must be no more than one <main> tag in a document

  • <main> tag is similar to a Landmark; as landmarks quickly identify and navigation becomes easier in a large document with their help.

  • Also, this is a Block-level element.

HTML <main> Tag Syntax

The <main> tag requires the start(opening) tag and end(closing) tag.

<main>
....content here
</main>

HTML <main> Tag Basic Example

Below we have a basic example for a clear understanding of the <main> tag:

HTML <main> Tag Attributes

This element does not have any specific attributes although this element supports Global and Event attributes.

Browser Support for HTML <main> Tag

Following browsers support this attribute:

  • Google Chrome 9.0

  • Internet Explorer 11.0

  • Firefox 4+

  • Opera

  • Safari