HTML mainTag

Examples

Use the main tag to display the main content of the document:

<main> <h1>Web Browsers</h1> <p>Google Chrome, Firefox, and Internet Explorer are currently the most popular browsers.</p> <article> <h1>Google Chrome Browser</h1> <p>Google Chrome Browser is a free open-source web browser developed by Google, released in 2008.</p> </article> <article> <h1>Internet Explorer Browser</h1> <p>Internet Explorer Browser is a free web browser developed by Microsoft, released in 1995.</p> </article> <article> <h1>Mozilla Firefox Browser</h1> <p>Firefox Browser is a free open-source web browser from Mozilla, released in 2004.</p> </article> </main>

Try it Yourself »

Definition and Usage

The <main> tag is used to specify the main content of a document.

The content inside the <main> tag is unique in the document. It should not contain content that is repeated across the document, such as sidebars, navigation bars, copyright information, site logos, or search forms.

NoteIn a document, the <main> element is unique, so there cannot be more than one <main> element. The <main> element cannot be a descendant of the following elements: <article>, <aside>, <footer>, <header>, or <nav>.


Browser Support

The numbers in the table indicate the first browser version that fully supports the element.

Element
<main> 6.0 12.0 4.0 5.0 11.1

Differences between HTML 4.01 and HTML5

The <main> tag is newly added in HTML5.

Other Extensions