GN Math logoGN Math
CSS Diner

CSS Diner

CSS Diner teaches selectors by setting a table. Plates, apples, pickles and bento boxes sit in a row, the ones you need to pick wiggle, and you type a CSS selector that grabs exactly those items.

Luke Pacholski built it as an open-source teaching game, and it works in a regular browser tab, which makes it a good fit for a coding class on school laptops. There are 32 levels, from plain element names to tricky pseudo-classes.

How to play CSS Diner

The table fills the top of the screen. Below it, a CSS editor waits on the left and an HTML viewer on the right shows the markup behind every item. Hover over a dish or a line of code to see how the two match up.

Type a selector and press Enter. If it picks exactly the wiggling items and nothing else, they fly off the table and the next level loads. If not, the editor gives a little shake, and nothing is lost by guessing again.

The side panel explains each new idea with an example, such as the id selector, the descendant selector or nth-child. Use the arrows by the level title or the level menu to move around freely.

Controls

ActionKeyboardMouseTouch
Type a selectorType in the CSS editor——
Check the answerEnterClick the enter button—
Inspect an item—Hover over it or its HTML line—
Change levelType a level number, then EnterUse the level arrows or menu—
Close the menuEsc——

Tips

  • Read the HTML viewer before typing. The tag names and classes there are the words you get to use.
  • Your answer does not need to match the example. Any selector that picks the same set of items is accepted.
  • Remember that a space means inside. Plate apple finds apples sitting on plates, while plate, apple picks both kinds.
  • For the nth-child levels, count from 1, not 0, and look at all siblings, not just the ones of one type.
  • When stuck, hover over each wiggling item to compare its markup with the items that stay still.

If you like CSS Diner, try these

  • Flexbox Lily Pond

    Typing real CSS remains the task, using flexbox properties to move frogs onto matching lily pads.

  • SQL Detective Mystery

    Selecting the right items carries over to databases, where SQL queries reveal who committed the crime.

Questions

Does CSS Diner save my progress?

Yes. Your current level and the levels you have finished are stored in the browser. Solved levels get a check mark in the menu, and Reset Progress clears them.

Is CSS Diner good for complete beginners?

Yes. The first levels only ask for a tag name like plate, and every level has a short explanation and example on the side, so you learn one idea at a time.

Can I play CSS Diner on a tablet?

You can type with an on-screen keyboard, but the hover previews need a mouse and the layout wants a wide screen. A laptop or Chromebook is more comfortable.

More like this: all puzzle games · every game A–Z

More puzzle games

See all →
Elevator Saga game screenElevator SagaPuzzleLearn Git Branching game screenLearn Git BranchingPuzzleRobot Coder game screenRobot CoderPuzzleSQL Detective Mystery game screenSQL Detective MysteryPuzzle2048 game screen2048PuzzleMahjong Solitaire game screenMahjong SolitairePuzzleWord Search game screenWord SearchPuzzleBlack Box Lasers game screenBlack Box LasersPuzzleBlack Hole Square game screenBlack Hole SquarePuzzleBlock Drop game screenBlock DropPuzzle