Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML main tag

HTML main tag

Example

Using the main tag to display the main content of a document:

<

main

<

h1

Web Browser

h1

<

p

Google Chrome, Firefox, and Internet Explorer are currently the most popular browsers.

p

<

article

<

h1

Google Chrome Browser

h1

<

p

The Google Chrome browser is a free, open-source web browser developed by Google and released in 2008.

p

article

<

article

<

h1

Internet Explorer Browser

h1

<

p

The Internet Explorer browser is a free web browser developed by Microsoft and released in 1995.

p

article

<

article

<

h1

Mozilla Firefox browser

h1

<

p

The Firefox browser is a free, open-source web browser from Mozilla, released in 2004.

p

article

main

Try it »


Definition and Usage

The tag is used to specify the main content of a document.
The content inside the tag should be unique in the document. It should not contain content that repeats elsewhere in the document, such as sidebars, navigation bars, copyright information, site logos, or search forms.

Note that in a document,

the element is unique, so there cannot be more than one
.
The element must not be a descendant of the following elements:

,