Challenge 5 of 5 · Final

Challenge 5: Make it responsive

One media query turns a desktop page into a real website.

0 of 5 complete 5/5 ✓ Completed

What you're building

Add one @media query that changes the layout on smaller screens. This is genuinely the 80/20 of "make it work on phones" — one rule, enormous payoff.

How the editor knows you're done

The code contains @media somewhere in the CSS.

A starting point

Add this to the bottom of your CSS panel:

/* Stack the layout vertically on phones */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 12px;
  }
  h1 { font-size: 1.5rem; }
}

Now drag the corner of the preview to make it narrow — or open the preview in a new window and resize it. You'll see the layout reflow at 768px wide.

Open in editor → Back to all challenges →