VOOZH about

URL: https://www.geeksforgeeks.org/html/html-main-tag/

⇱ HTML <main> Tag - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <main> Tag

Last Updated : 29 May, 2026

The HTML <main> tag represents the primary content of a web page. It contains the central information unique to the document, excluding repeated elements such as navigation menus, sidebars, headers, and footers.

  • Identifies the main topic or purpose of the web page.
  • Improves page structure and semantic meaning.
  • Helps assistive technologies locate the primary content easily.
  • There should be only one <main> element per document.
  • Should not be placed inside <header>, <footer>, <nav>, or <aside> elements.

Syntax:

<main>
 // contents of main Element 
</main> 

Note: The document must not contain more than one <main> element. The <main> element should not be a child element of an <article>, <aside>, <footer>, <header>, or <nav> element. 

HTML <main> Tag Examples

Example: Using the <main> tag, it encapsulates main content, including headings and articles, conforming to HTML5 semantics.

Comment
Article Tags: