Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

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

  1. <main>
  2.  <h2>Apples</h1>
  3.  <p>The apple is a red color pomaceous fruit of the apple tree. It is a very famous saying about apple.
  4.   </br> “An apple in a day, keeps the Doctor away”.</p>
  5.  <article>
  6.   <h3>Red Delicious</h3>
  7.   <p>These bright red apples are the most common found in many supermarkets.</p>
  8.  </article>
  9.  <article>
  10.  <h3>Granny Smith</h3>
  11.  <p>These juicy, green apples make a great filling for apple pies.</p>
  12.  </article>
  13. </main>

Test it Now



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

Element chrome_browser Chrome ie_browser IE firefox_browser Firefox opera_browser Opera safari_browser Safari
<main> Yes No Yes Yes Yes