MAIN <main> Tag

by Jai 17-Jul-19

0 315


The <main> tag in HTML5 is known as a block-level tag. <main> tag is for representing  the main content of the <body> tag in the HTML document. It is placed within the <body> tag. It is used to accurately describe the primary content of a page. Only one <main> Tag is to be placed in a document. The <main> tag should not be placed in the <aside>, <header>, <footer>, <article> or <nav> tags. Therefore it should not be placed as a child of an <header>, <nav>, <article>, <aside>, <footer> element.

Program:

<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <title> Main Tag </title>
</head>
<body>
<main>
 <article>
  <h1>Article Heading 1</h1>
   <p>Dummy data</p>
 </article>
 <article>
  <h1>Article Heading 2</h1>
   <p>Dummy data </p>
 </article>
</main>
<p><strong>Note:</strong> The main tag is not supported in Internet Explorer 11 and earlier versions.</p>
</body>
</html>

Output:

MAIN <main> Tag


Share:


Comments

    Waiting for your comments

Leave a Reply