Javatpoint Logo
Javatpoint Logo

HTML Main Tag

HTML <main> tag is used to represent the main content of the <body> tag.

The <main> tag is written within <body> tag. It is used to accurately describe the primary content of a page.

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

HTML <main> is a new tag and introduced in HTML5.


Points to remember:

Author should not include more than one <main> tag within a document.

The <main> element should not used as a child of an <article>, <aside>, <header>, <footer>, or <nav> element.

HTML main tag and its sub elements can be easily styled by CSS.


HTML main tag example

Test it Now

Output:

Apples

The apple is a red color pomaceous fruit of the apple tree. It is a very famous saying about apple.
"An apple in a day, keeps the Doctor away".

Red Delicious

These bright red apples are the most common found in many supermarkets.

Granny Smith

These juicy, green apples make a great filling for apple pies.


The <main> tag also supports global attributes and event attributes in HTML 5.


Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<main>YesNoYesYesYes
Next TopicHTML Wbr Tag




Please Share

facebook twitter google plus pinterest tumbler

Learn Latest Tutorials