Skip to content
KBHXgamesAll games

Play CSS Diner Online

Learn CSS selectors by typing rules that pick the right food off a dinner table, across 32 levels.

CSS Diner gameplay screenshot
  • Phones: some features

Tip: rotate your phone to landscape for a larger screen.

CSS Diner at a glance

Genre
Puzzle Games
Play with
Keyboard, Mouse
On phones
Partly
Players
1 player
Price
Free, no sign-up
License
MPL-2.0

CSS Diner is a playful way to learn CSS selectors, the patterns that tell a stylesheet which elements to style. Each level sets a table with plates, bento boxes, apples, oranges and pickles, then gives an order like “Select the small apples.” You answer by typing a selector. The table is built from real HTML, so your rule is tested against actual elements and you see the result at once.

What Is CSS Diner?

It is a 32-level tutorial in game form. Every level focuses on one selector type, and the items you need to target bounce on the table. Below the table, an HTML Viewer shows the markup, and a side panel explains the selector of the day with examples. Clearing level 32 finishes the game.

How a Round Plays Out

  1. Read the order and watch which items bounce.
  2. Check the HTML Viewer to see the tags, classes and IDs involved.
  3. Type a selector in the CSS Editor and press Enter.
  4. If it picks exactly the right items, they fly off the plate and the next level loads.
  5. If it picks too many, too few or none, the editor shakes and you try again with no penalty.

The levels climb in a steady order. You begin with element names, IDs and classes. Then come descendants, commas and the universal selector, followed by the sibling and child combinators. Later levels cover pseudo-classes such as first-child, nth-child, only-of-type, empty and not, and the final stretch is attribute selectors.

Keys and Buttons for CSS Diner

Keyboard, mouse and touch controls for CSS Diner
What you do⌨ Keyboard🖱 Mouse
Type a selectorType in the CSS Editor box—
Check your answerEnterClick the "enter" button
Jump to a levelType the level number, then EnterOpen the menu (top right) and click a level
See an item's HTML—Hover over an item on the table or a line in the HTML Viewer
Previous or next level—Click the arrows beside the level title
Close the level menuEsc—

Winning Strategies

  • Read the markup, not just the order. The HTML Viewer shows exactly which names you can target.
  • Hover to connect items and code. Pointing at a dish highlights its line of HTML, and the reverse works too.
  • Count from 1 in nth selectors. The third child is nth-child(3), not nth-child(2).
  • Watch the space. A space matches anything nested inside, while the greater-than sign matches only direct children.
  • Borrow from the examples. The help panel shows a working pattern you can adapt.

Handy Details

  • Type a level number and press Enter to jump straight to it.
  • The layout is made for wide screens, and hover tips need a mouse, so a computer works best.

Who Should Play It

CSS Diner is ideal for new web developers, students and designers who want selectors to finally click. If you like coding puzzles or other learn-by-doing tutorials, it turns dry syntax into short, satisfying challenges.

Played and checked by the KBHX Games team · updated

CSS Diner: Questions and Answers

Is CSS Diner free, and do I need coding experience?

It is free in your browser, and no experience is required. Each level explains its selector with syntax and examples in a help panel, so complete beginners can follow along. People who already know CSS can use it as a quick refresher.

Must my answer match the example selector?

No. The game only checks which items your selector picks. If it grabs exactly the bouncing items and nothing else, the level is solved, even when you wrote the selector in a different way from the example.

Will CSS Diner remember where I stopped?

Yes. Your current level and the levels you solved are stored in your browser. Solved levels show a checkmark in the level menu, and a Reset Progress link at the bottom of that menu wipes everything if you want to start fresh.

If You Liked CSS Diner, Try These