thecodezone.
The Code Zone
← Back to the Developer Playbook

Code Zone Bug Lab / Episode 21

Help Codi: The Project Cards Stuck Together

Codi’s Garden journal is trapped inside her Recipe page card. Trace the HTML boundaries and give each project its own space.

CODI-002 · HTML, Nesting5–8 minutesNo setup or account required
Codi notices one project card inside another; Rob traces their boundaries; Codi displays two separate project cards.
Both projects exist. Investigate which article contains the second project.

Your sprint ticket · In progress · CODI-002

Two projects share one card boundary.

Customer report: Codi: “Garden journal should be its own card. Why is it sitting inside Recipe page?”

Steps to reproduce

  1. Look at the Recipe page and Garden journal projects in the preview.
  2. Select index.html and find the PROJECT 1 and PROJECT 2 comments.
  3. Follow where each article starts and ends.

Repair the article boundaries in index.html. Keep both projects, their ids, headings, paragraphs, and the supplied CSS.

Acceptance criteria

  • Exactly two article elements keep the class project-card.
  • Both project articles are direct children of the project-gallery div.
  • Each project keeps its own heading and description.
  • Cards sit beside one another on wide screens and stack on phones.

You are the reviewer. Make one focused repair, then explain to Codi what caused the problem. No JavaScript is required.

Reproduce → inspect → hypothesize → verify

Take the ticket.

In index.html, compare the article boundaries around PROJECT 1 and PROJECT 2. Repair the nesting so both project articles sit directly inside the div with class project-gallery. Keep each project’s heading and paragraph inside its own article, then use Check challenge.

Checking account and saved lab work…

Sign in to sync across devices

Loading the HTML and CSS editor…

Desired result

Compare this expected page with your preview. Your code stays in your editor.

Pass the checks or make three attempts to unlock an explained example.

Ready to test? Choose “Check challenge” after investigating.

    Open starter in a separate tab

    Code and prediction notes recover in this browser and sync when signed in. Instructor examples stay separate. Reset replaces code, not prediction notes.

    One possible solution

    Compare this approach with your own. Opening it does not change your code or mark the exercise complete.

    The first article stayed open when the second article began. Moving its closing tag above PROJECT 2 makes the two articles siblings, meaning they share the same parent. Indenting the HTML alone would not fix that relationship.

    Tell Codi: “Garden journal was inside Recipe page because the first article ended too late.” Test both wide and phone previews.

    One possible correction
    index.htmlhtml · example
    <main>
      <h1>Codi’s project shelf</h1>
      <div class="project-gallery">
        <!-- PROJECT 1: Keep its heading and description together. -->
        <article class="project-card" id="recipe-project">
          <h2>Recipe page</h2>
          <p>A page for my favorite soup.</p>
        </article>
    
        <!-- PROJECT 2: This should be a separate card beside Project 1. -->
        <article class="project-card" id="garden-project">
          <h2>Garden journal</h2>
          <p>A home for my plant notes.</p>
        </article>
      </div>
    </main>

    Try first. Reveal one clue at a time.

    Need a lead?

    1. Find the first boundary.

    An article starts with an opening tag and ends at its matching closing tag. Indentation helps you read this, but it does not change nesting.

    2. Follow the second card.

    PROJECT 2 starts before Recipe page’s article has ended. The browser therefore puts Garden journal inside Recipe page.

    3. Move, do not duplicate.

    Move the final closing article tag to directly after the soup paragraph and before the PROJECT 2 comment. Keep the other closing article tag after the plant-notes paragraph.

    Your lab report

    Show your reasoning.

    “I expected… I observed… The console showed… My hypothesis was… I changed… I verified…”

    Use Check challenge for automated behavior checks. Passing checks are useful evidence, not a complete code review.

    Give others room to investigate: label solutions as spoilers.

    Share your lab report on SKOOL (new tab) ↗