Recent chats
ASKGEEZ Q&A GUIDETechnology & devices

How do I organize a page into header, navigation, main, and footer regions?

Quick answer

Use <header> for introductory content, <nav> for a group of navigation links, <main> for the page’s primary content, and <footer> for footer content. Choose each element because of what its content does, not how it looks. A header or footer can belong to the whole page or to a particular article or section, so check which content it introduces or closes. [S1]

LET’S WORK THROUGH IT

The question, the details, the next step.

Question

I’m starting a page and keep mixing up header, navigation, main, and footer. What is the practical difference between them?

Geez

Think of these elements as labels for the purpose of content, not as four visual boxes you must place on every design. <header> introduces a page or a particular section. <nav> groups links used to navigate the site or parts of the page. <main> marks the page’s primary content. <footer> holds footer content for the page or a section. [S1]

A useful first question for each region is: “What job does this content do?” A logo and introductory site content may belong in the page-level header; a set of links to other areas is navigation; the article someone came to read is main content; and closing information can go in a footer. The visual design may put these areas in different places, but appearance alone does not decide their meaning.

Follow-up question

Can you show me a simple skeleton and explain how I decide whether a header or footer belongs to the whole page or to an article?

Geez

Here is a minimal starting point. Replace the bracketed notes with your own content; the notes are placeholders, not required wording.

<body>
  <header>
    <!-- Page-level introduction, such as a site name -->
  </header>

  <nav>
    <!-- Links for moving around the site or page -->
  </nav>

  <main>
    <article>
      <header>
        <!-- Introduction to this article -->
      </header>

      <!-- The article's primary content -->

      <footer>
        <!-- Footer content for this article -->
      </footer>
    </article>
  </main>

  <footer>
    <!-- Footer content for the page -->
  </footer>
</body>

Use a page-level <header> when its introductory content relates to the page as a whole. If a header introduces only an article or section, put it with that content instead. Apply the same relationship test to a footer: does it close or provide footer content for one section, or for the page? These elements can describe areas at different levels. [S1]

The skeleton is a planning aid, not a rule that every page must contain every region or nested arrangement shown.

Follow-up question

My design has a row of links beside the article and a title above it. Should I use the visual position to choose the elements?

Geez

No—first identify the purpose of each piece, then arrange it visually. A row of links used to reach site areas or sections is navigation, even if the design places it beside the article. A title and introduction might be a page header if they introduce the whole page, or an article header if they introduce only that article. The article’s primary content belongs in <main> as the page’s main content. [S1]

For example, if a page contains a site name, links to “Topics” and “About,” and an article titled “Choosing a page structure,” you could plan the site name as the page header, those links as navigation, and the article as the main content. The article title can be grouped with the article’s own introduction. That example illustrates the decision; it does not determine your design or the exact content your page needs.

Follow-up question

Before I build the page, can you give me a quick decision guide to check my choices?

Geez

Use this short sequence:

  1. Identify the content the page is chiefly presenting; mark that area as <main>.
  2. Find groups of links whose purpose is moving around the site or page; consider <nav> for those groups.
  3. For introductory content, ask what it introduces: the whole page, or just a section or article? Choose the corresponding header context.
  4. For closing or footer content, ask what it belongs to: the whole page, or a particular section or article?
  5. Review your choices by meaning, not by whether the elements happen to look like a banner, bar, or box. Semantic elements express purpose rather than appearance. [S1]

This guide helps organize a document, but it does not establish that any particular visual layout is required. Decide the content relationships first, then implement the presentation to suit your design.

A practical checklist

  • Mark the page’s primary content as the main region.

  • Use navigation for groups of links intended to move around the site or page.

  • Decide whether each introduction belongs to the whole page or a particular section.

  • Decide whether each footer belongs to the whole page or a particular section.

  • Check that each element reflects content purpose rather than visual styling.

A few more useful answers

Does a header always mean the top banner of a page?

No. A header can introduce the whole page or belong to an article or section. Choose its scope by what it introduces, not where it appears visually. [S1]

Is every set of links navigation?

Use <nav> for links serving a navigation purpose, such as links to site areas or page sections. The element describes that purpose, not merely the fact that text is linked. [S1]

Can an article have its own header and footer?

Yes. Header and footer elements can describe content belonging to an article or section as well as content for the page overall. [S1]

Sources

References used for this guide.

  1. [S1] Structuring documents with semantic page regions
    developer.mozilla.org · Checked

YOUR QUESTION. YOUR DETAILS.

Let’s work through your situation.

Get a tailored answer or help with your next task. Starts at $1, with a quote before you pay.

Ask your own question
← Back to Geez at Work