This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

main

Summary

Represents the main content of the body of a document or application.

Overview Table

DOM Interface
HTMLElement

Examples

The following example shows a basic usage of the <main> element

<!DOCTYPE html>
<html>
<head>
  <title>Main element example</title>
</head>
<body>
  <header>
    <h1>The main element</h1>
  </header>
  <main>
    <h2>Some content on the main element</h2>

    <article>
      ...
    </artice>
    <section>
      ...
    </section>
  </main>
  <footer>
    Copyright 2013 Web Platform
  </footer>
</body>
</html>

Notes

  • It is advised to use ARIA role="main" attribute on the main element until browsers have implemented the element.

  • There must not be more than one <main> element in a document, and it must not be a descendent of an <article>, <aside>, <footer>, <header>, or <nav> element.

Related specifications

HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation

See also

Related articles

Document Structure