Create a kickass page structure

A sandwich and chips on a plate. Photograph by Daniel Boberg

What is a page structure?

A page structure tells your user the different regions of your page.

Some of the people you are helping by having a good page structure include:

  • People with cognitive and learning disabilities
  • People using screen readers
  • Keyboard users

To learn more, read “Understanding disabilities”

The video below features RuPaul, with a sandwich in hand, saying “This sandwich is flawless!!”

RuPaul is here to help you build a flawless sandwich… umm page structure

A page structure is like a delicious sandwich. The header and footer are the bread pieces of your sandwich, the main section is like the meat or tofu of your sandwich, and the aside are the chips you have next to your sandwich.

Before you grab something to eat (that made me hungry too), let’s go into detail about what makes a flawless page structure.

How should I structure my page?

Standard page structure, includes header, navigation, main, article, aside, and footer elements
A visual of a basic page structure

Your HTML code will look something like this:

<header>
    <nav>
        <ul>
            <li>link1</li>
            <li>link2</li>
            <li>link3</li>
        </ul>
    </nav>
</header>
<main>
    <article>
        <h3>Article heading</h3>
        <p>article paragraph</p>
    </article>
    <article>
        <h3>Article heading</h3>
        <p>article paragraph</p>
    </article>
    <article>
        <h3>Article heading</h3>
        <p>article paragraph</p>
    </article>
</main>
<aside>
    <ul>
        <li>list1</li>
        <li>list2</li>
        <li>list3</li>
    </ul>    
</aside>
<footer>
    <p>&copy; 2022 My Cool Website</p>
</footer>

Let’s break this down:

  • <header>
    • This usually contains the name of the site, a logo, and sometimes a tagline
    • Some websites include the <nav> (site navigation) in the header
    • Most websites will have the same header content on every page of their site
  • <main>
    • This section has the main content of your page
      • Remember, if your webpage were a sandwich, this would be the meat or tofu of your page. So make sure it’s enticing
    • The main section usually contains <article>
      • An article is a self-contained element of your page. Examples include blog entries, product cards, widgets, magazine or newspaper articles, etc.
      • If this were a sandwich, it would be like the tomato slices and lettuce leaves
  • <aside>
    • This is where you keep content that’s indirectly related to your document’s main content
    • As I said before, this would be like the chips next to your sandwich, it’s not part of your sandwich, but it gives you a delicious meal
  • <footer>
    • The footer usually has important links, copyright information, contact information, etc.
    • The footer is your other slice of bread
Notice that I used semantic HTML in my example.  What's semantic HTML? Semantic HTML describes the meaning of your element to your browser. For instance a <div> can be anything, but a <header> is only a header  

But I have DIVs everywhere, now what?

Talk to your developers and ask how much effort it would take to update your page structure. Usually, these changes can be done at the template level and may require updating your CSS file(s).

Using semantic HTML is best, but here’s another way to label the different regions of your page.

Semantic HTMLLandmark roleCode sample
<header>banner<div role="banner">
<nav>navigation<div role="navigation">
<main>main<div role="main">
<article>article<div role="article">
<aside>complementary<div role="complementary">
<footer>contentinfo<div role="contentinfo">
Identify your page’s regions using semantic HTML. If not, use their corresponding role

I will warn you, your developer(s) may tell you that it’ll only be a bit more work or just as much work to add the roles as it is to update your code to semantic HTML.

I highly recommend going the semantic HTML route. Make your sandwich FLAWLESS.