HTML <main> Tag

The main content of the <body> tag can be specified using the HTML <main> tag. Thus, the primary content of a page can be accurately described using the HTML <main> tag. It is placed within the HTML <body> tag. It was introduced in HTML5. It is recommended to use only one <main> tag within a document, and this tag should not be used as a child of the HTML <article>, <aside>, <header>, <footer>, and <nav> elements.


<!DOCTYPE html>
  <p>Health includes both the physical and mental well-being.</p>
    <p>Eat balanced-diet to stay healthy.</p>
    <p>Exercise daily to stay fit and healthy.</p>
    <p>Take proper rest and sound sleep to stay healthy.</p>


In the above example, we are using the HTML <main> tag to specify the primary content of the document.

Global Attributes:

The HTML Global attributes are supported by the HTML <main> tag.

Event Attributes:

The HTML Event attributes are supported by the HTML <main> tag.

Supporting Browsers:

Chrome, IE, Firefox, Opera, and Safari.