Skip to content
WANCODE
BM

Build a Responsive Navbar

20 minIntermediateCSS

Kopi Pak Mat's website looks fine on nobody's screen: the links sit awkwardly under the logo on a laptop and squash together on a phone. Rebuild the header layout with CSS so it adapts to the screen width.

  • Wide (≥ 600px): Kopi Pak Mat on the left, Menu · About · Location · Contact in a single row on the same line, to its right.
  • Narrow (< 600px): the logo on top, then the four links stacked one under another.
  • At every width: nothing sticks out sideways (no horizontal scrollbar).

Constraints

  • Use CSS only — no JavaScript and no hamburger toggle for this one. Keep the HTML structure and the .logo class.
  • The checker renders your page in hidden test frames that are exactly 360px and 900px wide, so your media query genuinely has to work.

Make the header responsive: on screens 600px and wider the logo sits left with the links in one row beside it; below 600px the links stack in a column under the logo.

Checks

  • At 900px: logo left, links in one row beside it
  • At 360px: links stacked under the logo
  • No sideways scrolling at 360px or 900px
Preview

Console output from your code appears here.

Step 1 of 1