thecodezone.
The Code Zone
← Back to the Developer Playbook

Code Zone Bug Lab / Episode 20

Help Codi: The Achievement Badge That Lost Its Style

Codi earned an achievement, but her badge looks like plain text. Compare HTML and CSS to find one mismatched class name.

CODI-001 · HTML, CSS selectors3–5 minutesNo setup or account required
Codi shows plain achievement text, Rob compares a badge label with a style label, and the same achievement appears as a cyan badge.
The achievement text exists. Investigate why its badge styling never reaches it.

Your sprint ticket · In progress · CODI-001

An earned achievement looks unstyled.

Customer report: Codi: “My achievement should be a rounded cyan badge. I can read the words, but the badge style is missing.”

Steps to reproduce

  1. Look at First page complete in the preview.
  2. Select index.html and find the achievement span.
  3. Select styles.css and compare the achievement rule with that span.

Fix the class selector in styles.css. Keep the existing HTML, text and badge declarations.

Acceptance criteria

  • One achievement span still reads First page complete.
  • The badge has its cyan background, padding and rounded corners.
  • The learning journal heading stays unchanged.

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.

Compare the achievement class in index.html with its rule in styles.css. Correct the selector spelling. Keep the existing declarations. Use Run code to inspect the preview, then 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 HTML class is achievement-badge, but the CSS rule selects achievement-badges. Those are different class names. Matching the selector makes the existing declarations reach the span. No new properties or JavaScript are needed.

    Tell Codi: “The text was present. The selector did not match, so the badge declarations never applied.”

    One possible correction
    styles.csscss · example
    * {
      box-sizing: border-box;
    }
    body {
      margin: 0;
      padding: 24px;
      background: #0b1728;
      color: #edf5ff;
      font:
        18px/1.6 Arial,
        sans-serif;
    }
    main {
      max-width: 680px;
      margin: 0 auto;
    }
    h1 {
      font-size: 1.7rem;
    }
    
    /* Achievement badge: inspect which HTML class this rule selects. */
    .achievement-badge {
      display: inline-block;
      background-color: #38bdf8;
      color: #082032;
      padding: 8px 16px;
      border-radius: 999px;
      font-weight: 700;
    }

    Try first. Reveal one clue at a time.

    Need a lead?

    1. Compare the names.

    A CSS class selector begins with a dot. Its name must match the class attribute exactly.

    2. Look at the ending.

    Compare achievement-badge in the HTML with the class name at the start of the CSS rule. Is one spelling plural?

    3. Keep the HTML.

    The badge’s class is correct. Remove the extra s from the CSS selector, keeping the declarations inside that rule.

    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) ↗