← Teacher guide

Challenge: lay out the club page

Students lay out the Course A club page in three milestones with fading support (header and menu, then a hero and a wrapping row of cards, then the table, a sign-up card and the footer), then make it their own.

Layout and components · Final challenge: lay out the club page · about 90 minutes · Open the student lesson

Classroom resources

Load these into Waypoints Prepare: choose Load URL and paste the copied address, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.

Students will be able to

Timing

Plan 10 min · Milestone 1 15 min · Milestone 2 25 min · Milestone 3 25 min · Make it yours 15 min

Before class

Read the challenge primer "Running the final challenge", then build milestone 1 yourself and plan milestones 2 and 3 on paper.

There is nothing new in this lesson. The starter is the finished Course A club page, so students who skipped Course A can still start here. Every milestone recalls earlier lessons: rules that combine and nav a, block and inline, the box, Flexbox rows, gap, justify-content, wrapping and components. Support fades on purpose: milestone 1 gives the exact code, milestone 2 an outline in comments, milestone 3 only the goals. There is no separate review step, because the whole lesson is review. Finishing this lesson marks Challenge complete on the course page.

Running the lesson

  1. Plan the layout: match each part to its rule. Write the parts on the board as a checklist.
  2. Milestone 1: everyone should finish this in the first lesson. Ask where display: flex goes, and why there are two flex boxes.
  3. Milestone 2: the outline is in the comments. Students who are stuck can use Reset to this task's start to load a working milestone 1.
  4. Milestone 3: goals only. Ask students to name which earlier rule each goal reuses before typing.
  5. Make it yours: any club or event. Ask for a fourth card made by copying, with no new CSS.

In class

On the slides at these points. Students can do the whole lesson on their own; these are for the room. In the deck, the Run, Modify and Make slides have the live playground in them (the tutorial link is the backup), and the notes above are in each slide's speaker notes.

The hard part (on purpose)

Planning a whole layout from parts they already know, and putting display flex on the right box. Have them name the box that holds the items first.

When students get stuck

What you will seeA question to askThe fix
Nothing moved in the header.Which box holds the name and the menu, and does it have display flex?Put display flex on the header, the box that holds them, not on the h1 or the nav.
The menu links are still stacked in a column.Which box holds the links?Put display flex on nav ul, the list that holds the li items.
The cards stay in one row and squash when they have no min-width.Does the row have flex-wrap wrap, and does the card have a min-width?Add flex-wrap wrap to .cards, and flex 1 with min-width 200px to .card.
The labels still sit beside their boxes.Are labels block or inline?Labels are inline. Add label { display: block; }.

Answers to the checks

  1. Name the parts: Match each part of the laid-out page with the rule that makes it.
    The club name on the left, the menu on the right → F. display: flex and justify-content: space-between on the header; The menu links in a row, without underlines → A. nav ul { display: flex; } and nav a { }; Three cards that share one look → B. one class on all three, and one .card rule; Cards that drop to a new line on a phone → E. flex-wrap: wrap, with flex: 1 and a min-width on the card; Room inside each card, and a line around it → C. padding and border; Each form label on its own line → D. display: block on label
    Each part is a lesson you have done. Build them in order: header and menu, then the hero and cards, then the table, form and footer.
  2. Count the cost: You add a fourth card to the row. How much new CSS do you write?
    None: copy a card, and the .card rule styles it too
    A class is shared by every copy. Adding a card is copying HTML, not writing CSS.

Solutions

One possible solution for each task. Other correct programs are fine.

Build the layout › Milestone 1: header and menu

<style>
  header {
    background-color: lightblue;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  nav ul {
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0;
  }
  nav a {
    text-decoration: none;
  }
  h1 {
    color: navy;
  }
  a {
    color: darkblue;
  }
  h2 {
    color: darkblue;
  }
  .winner {
    background-color: gold;
  }
  footer {
    background-color: lightblue;
    text-align: center;
  }
</style>
<header>
  <h1>Chess club</h1>
  <nav>
    <ul>
      <li><a href="#about">About</a></li>
      <li><a href="#results">Results</a></li>
      <li><a href="#join">Join</a></li>
    </ul>
  </nav>
</header>
<main>
  <section id="about">
    <h2>About the club</h2>
    <p>We play chess every Wednesday at lunch in the library. All levels welcome.</p>
    <p>Bring:</p>
    <ul>
      <li>a friend</li>
      <li>a snack</li>
      <li>your best opening</li>
    </ul>
    <img src="trophy.svg" alt="A gold trophy" width="100">
  </section>
  <section id="results">
    <h2>Results this term</h2>
    <table>
      <tr><th>Player</th><th>Wins</th></tr>
      <tr class="winner"><td>Ada</td><td>5</td></tr>
      <tr class="winner"><td>Sam</td><td>5</td></tr>
      <tr><td>Priya</td><td>3</td></tr>
    </table>
  </section>
  <section id="join">
    <h2>Join the club</h2>
    <form>
      <p><label for="name">Name</label>
      <input id="name" type="text"></p>
      <p><label for="group">Group</label>
      <select id="group">
        <option>Beginners</option>
        <option>Players</option>
        <option>Champions</option>
      </select></p>
      <button>Join</button>
    </form>
  </section>
</main>
<footer>
  <p>Contact: chess@example.com</p>
</footer>

Build the layout › Milestone 2: a hero and cards

<style>
  header {
    background-color: lightblue;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  nav ul {
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0;
  }
  nav a {
    text-decoration: none;
  }
  h1 {
    color: navy;
  }
  a {
    color: darkblue;
  }
  h2 {
    color: darkblue;
  }
  .winner {
    background-color: gold;
  }
  footer {
    background-color: lightblue;
    text-align: center;
  }
  .hero {
    background-color: lightyellow;
    text-align: center;
    padding: 32px;
    margin: 16px 0;
  }
  .cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
  }
  .card {
    flex: 1;
    min-width: 200px;
    padding: 16px;
    border: 2px solid navy;
  }
</style>
<header>
  <h1>Chess club</h1>
  <nav>
    <ul>
      <li><a href="#about">About</a></li>
      <li><a href="#results">Results</a></li>
      <li><a href="#join">Join</a></li>
    </ul>
  </nav>
</header>
<main>
  <section class="hero">
    <h2>Welcome to Chess club</h2>
    <p>Learn the moves, play a friend and win a trophy.</p>
    <p><a href="#join">Join us today</a></p>
  </section>
  <section class="cards">
    <div class="card">
      <h3>When</h3>
      <p>Every Wednesday at lunch.</p>
    </div>
    <div class="card">
      <h3>Where</h3>
      <p>In the library.</p>
    </div>
    <div class="card">
      <h3>Who</h3>
      <p>Everyone, at any level.</p>
    </div>
  </section>
  <section id="about">
    <h2>About the club</h2>
    <p>We play chess every Wednesday at lunch in the library. All levels welcome.</p>
    <p>Bring:</p>
    <ul>
      <li>a friend</li>
      <li>a snack</li>
      <li>your best opening</li>
    </ul>
    <img src="trophy.svg" alt="A gold trophy" width="100">
  </section>
  <section id="results">
    <h2>Results this term</h2>
    <table>
      <tr><th>Player</th><th>Wins</th></tr>
      <tr class="winner"><td>Ada</td><td>5</td></tr>
      <tr class="winner"><td>Sam</td><td>5</td></tr>
      <tr><td>Priya</td><td>3</td></tr>
    </table>
  </section>
  <section id="join">
    <h2>Join the club</h2>
    <form>
      <p><label for="name">Name</label>
      <input id="name" type="text"></p>
      <p><label for="group">Group</label>
      <select id="group">
        <option>Beginners</option>
        <option>Players</option>
        <option>Champions</option>
      </select></p>
      <button>Join</button>
    </form>
  </section>
</main>
<footer>
  <p>Contact: chess@example.com</p>
</footer>

Build the layout › Milestone 3: table, form and footer

<style>
  header {
    background-color: lightblue;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  nav ul {
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0;
  }
  nav a {
    text-decoration: none;
  }
  h1 {
    color: navy;
  }
  a {
    color: darkblue;
  }
  h2 {
    color: darkblue;
  }
  .winner {
    background-color: gold;
  }
  footer {
    background-color: lightblue;
    text-align: center;
    padding: 16px;
  }
  .hero {
    background-color: lightyellow;
    text-align: center;
    padding: 32px;
    margin: 16px 0;
  }
  .cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
  }
  .card {
    flex: 1;
    min-width: 200px;
    padding: 16px;
    border: 2px solid navy;
  }
  table {
    width: 100%;
  }
  td, th {
    padding: 8px;
    border: 1px solid gray;
    text-align: left;
  }
  label {
    display: block;
  }
</style>
<header>
  <h1>Chess club</h1>
  <nav>
    <ul>
      <li><a href="#about">About</a></li>
      <li><a href="#results">Results</a></li>
      <li><a href="#join">Join</a></li>
    </ul>
  </nav>
</header>
<main>
  <section class="hero">
    <h2>Welcome to Chess club</h2>
    <p>Learn the moves, play a friend and win a trophy.</p>
    <p><a href="#join">Join us today</a></p>
  </section>
  <section class="cards">
    <div class="card">
      <h3>When</h3>
      <p>Every Wednesday at lunch.</p>
    </div>
    <div class="card">
      <h3>Where</h3>
      <p>In the library.</p>
    </div>
    <div class="card">
      <h3>Who</h3>
      <p>Everyone, at any level.</p>
    </div>
  </section>
  <section id="about">
    <h2>About the club</h2>
    <p>We play chess every Wednesday at lunch in the library. All levels welcome.</p>
    <p>Bring:</p>
    <ul>
      <li>a friend</li>
      <li>a snack</li>
      <li>your best opening</li>
    </ul>
    <img src="trophy.svg" alt="A gold trophy" width="100">
  </section>
  <section id="results">
    <h2>Results this term</h2>
    <table>
      <tr><th>Player</th><th>Wins</th></tr>
      <tr class="winner"><td>Ada</td><td>5</td></tr>
      <tr class="winner"><td>Sam</td><td>5</td></tr>
      <tr><td>Priya</td><td>3</td></tr>
    </table>
  </section>
  <section id="join">
    <h2>Join the club</h2>
    <form class="card">
      <p><label for="name">Name</label>
      <input id="name" type="text"></p>
      <p><label for="group">Group</label>
      <select id="group">
        <option>Beginners</option>
        <option>Players</option>
        <option>Champions</option>
      </select></p>
      <button>Join</button>
    </form>
  </section>
</main>
<footer>
  <p>Contact: chess@example.com</p>
</footer>

Build the layout › Test the layout

Open task: any program that does what the step asks.

Make it yours

<style>
  header {
    background-color: lavender;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  nav ul {
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0;
  }
  nav a {
    text-decoration: none;
  }
  h1 {
    color: navy;
  }
  a {
    color: darkblue;
  }
  h2 {
    color: darkblue;
  }
  .winner {
    background-color: gold;
  }
  footer {
    background-color: lavender;
    text-align: center;
    padding: 16px;
  }
  .hero {
    background-color: lightyellow;
    text-align: center;
    padding: 32px;
    margin: 16px 0;
  }
  .cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
  }
  .card {
    flex: 1;
    min-width: 200px;
    padding: 16px;
    border: 2px solid navy;
  }
  table {
    width: 100%;
  }
  td, th {
    padding: 8px;
    border: 1px solid gray;
    text-align: left;
  }
  label {
    display: block;
  }
</style>
<header>
  <h1>Choir club</h1>
  <nav>
    <ul>
      <li><a href="#about">About</a></li>
      <li><a href="#results">Results</a></li>
      <li><a href="#join">Join</a></li>
    </ul>
  </nav>
</header>
<main>
  <section class="hero">
    <h2>Welcome to Choir club</h2>
    <p>Sing with friends, learn new songs and perform at the concert.</p>
    <p><a href="#join">Join us today</a></p>
  </section>
  <section class="cards">
    <div class="card">
      <h3>When</h3>
      <p>Every Thursday at lunch.</p>
    </div>
    <div class="card">
      <h3>Where</h3>
      <p>In the music room.</p>
    </div>
    <div class="card">
      <h3>Who</h3>
      <p>Everyone, at any level.</p>
    </div>
  </section>
  <section id="about">
    <h2>About the club</h2>
    <p>We sing every Thursday at lunch in the music room. All levels welcome.</p>
    <p>Bring:</p>
    <ul>
      <li>a friend</li>
      <li>a water bottle</li>
      <li>your best voice</li>
    </ul>
    <img src="music.svg" alt="Music notes" width="100">
  </section>
  <section id="results">
    <h2>Concert results</h2>
    <table>
      <tr><th>Singer</th><th>Solos</th></tr>
      <tr class="winner"><td>Ada</td><td>5</td></tr>
      <tr class="winner"><td>Sam</td><td>5</td></tr>
      <tr><td>Priya</td><td>3</td></tr>
    </table>
  </section>
  <section id="join">
    <h2>Join the club</h2>
    <form class="card">
      <p><label for="name">Name</label>
      <input id="name" type="text"></p>
      <p><label for="group">Group</label>
      <select id="group">
        <option>Beginners</option>
        <option>Singers</option>
        <option>Champions</option>
      </select></p>
      <button>Join</button>
    </form>
  </section>
</main>
<footer>
  <p>Contact: choir@example.com</p>
</footer>

Stretch and support

Stretch: Add a fourth card, then a second row of cards. Try justify-content: center on the cards and see what changes. Try the optional lessons on Grid and on making the page react.

Support: Let students use Reset to this task's start at each milestone, so everyone reaches milestone 3. Pair students for milestone 3: one does the table, one the form.

Exit ticket

Name three parts of your layout and the rule behind each.

For example: the name left and the menu right is display flex with justify-content space-between on the header; the cards share one .card rule; the cards wrap because the row has flex-wrap wrap.

What each step is for

Where it leads

The finished page is a portfolio piece: students can name each part and the lesson it came from. Optional lessons follow: Grid for whole-page layouts, and Make it react for a first look at JavaScript.