Encodera

Thanks for reading!

Donate to the site — we work hard for you.

HTML & CSS reference

<main>

The main content of the page — what the user came for.

Syntax

<main>…</main>

Examples

A page skeleton:

<header>Logo and menu</header>
<main>
  <h1>Our coffee</h1>
  <p>Single-origin beans, roasted weekly.</p>
</main>
<footer>© 2026 The Bean</footer>

Notes

A page has only one visible <main>, and it is not placed inside <header>, <footer>, <nav> or <article>. Blocks repeated on every page (header, menu, footer) stay outside it.

See also

  • <header> — The header of a page or a section: logo, heading, navigation.
  • <footer> — The footer of a page or a section: contacts, copyright, links.
  • <article> — A self-contained piece that makes sense on its own: an article, a post, a review, a product card.
  • <body> — The visible part of the page: everything the user sees.

Related recipes

In the tutorial

  • Semantic markup — The neutral div and span and the meaningful header, nav, main, article, section, aside and footer tags for page structure.

Thanks for reading!

Donate to the site — we work hard for you.