Semantic Elements
HTML <main> element
Identifies the dominant content of the document. A document should not have multiple main elements without hidden attributes. Keep repeated site navigation, general banners and unrelated footers outside main. A single visible main landmark is useful for skip navigation and assistive technologies. It accepts global HTML attributes; individual global features may be inapplicable or restricted.
Formal Syntax & Structure
html syntaxhtml
<main>Primary content</main>Return Value
HTMLElement
Content model: Flow content; context-specific ancestor restrictions may apply.
Working Example
Example Snippethtml
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <title>HTML example</title> </head> <body> <main> <h1>Library</h1> <p>Browse the collection.</p> </main> </body></html>