Main Tag in HTML || HTML Main Tag
×

HTML MAIN <main> Tag

2534

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:



Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments