HTML main content - how to use <main> tag

The HTML <main> tag is used to define the main content of a document. The main content should be the "main" content and it should not contain sections like header, footer, navigation links, etc.

There should be only one <main> tag within a document.

The main tag should not be part of the <article>, <aside>, <footer>, <header>, or <nav> tags.


The main tag supports the global and event attributes.


<main> <h1>Asian countries</h1> <p>Large countries in Asia...</p> <article> <h1>China</h1> <p>The great wall of China is in China</p> </article> <article> <h1>India</h1> <p>India won the cricket world cup twice</p> </article> </main>