Play CSS Diner Online Free

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

CSS Diner title screen on SZ Games
  • Touch: some features

Tip: rotate your phone to landscape so the play area gets wider.

CSS Diner turns CSS selectors into a meal you serve one order at a time. Each level sets a table with plates, bento boxes, apples, oranges and pickles, then gives a short request such as “Select the small apples.” You write the selector that would target just those items. The table is built from real HTML, so your answer is tested on real elements.

What You Learn Here

Selectors are how a stylesheet points at parts of a page. They can look simple, but the details trip up many beginners. This game gives you a visual target for each rule, so you see right away which items your selector grabs.

Each level focuses on one idea. A help panel on the right names it, shows the syntax and gives examples you can adapt.

Serving an Order

Items you need to pick bounce on the table. Under the table, the HTML Viewer shows the markup for everything on it. Type your answer in the CSS Editor and press Enter.

If your selector matches exactly the bouncing items, they fly off the table. The level gets a checkmark and the next one opens. If it grabs too many, too few or none, the editor shakes so you can try again. Your answer does not need to match the example. Any selector that picks the right set counts.

How to Control CSS Diner

Input guide for CSS Diner
To do thisOn a keyboardWith a mouse
Enter a selectorType into the CSS Editor box—
Submit your answerPress EnterHit the "enter" button
Go to a specific levelType its level number, then press EnterOpen the top-right menu and pick a level
View an item's HTML—Rest the pointer on a table item or an HTML Viewer line
Step to the previous or next level—Use the arrows next to the level title
Dismiss the level menuPress Esc—

How the 32 Levels Build Up

  • Basics: element types, IDs and classes.
  • Combining: descendants, commas to group rules, and the * universal selector.
  • Relationships: the + and ~ sibling combinators and the > child combinator.
  • Pseudo-classes: :first-child, :nth-child, :nth-of-type, :only-of-type, :empty and :not().
  • Attributes: plain attribute matches plus ^=, $= and *=.

Finishing level 32 completes the game.

Helpful Habits

  • Read the markup, not just the order. The HTML Viewer shows the real tags and classes you can use.
  • Hover to connect the two views. Pointing at a table item lights up its code line, and pointing at a line lights up the item.
  • Remember nth counts from 1. plate:nth-child(3) is the third child.
  • Watch spaces. plate apple finds apples anywhere inside a plate, while plate > apple only finds ones directly on it.

Your current level and solved levels are saved in your browser. Type a number and press Enter to jump straight to that level.

Best Setup

CSS Diner works best on a computer with a mouse and keyboard. The side-by-side layout needs a wide screen, and the hover tooltips need a pointer. You can type on a phone, but the view is cramped. Once selectors click, try CSS Grid Carrot Patch to practice layout.

Last played and checked by SZ Games:

CSS Diner – Questions and Answers

Do I need to know CSS before I start?

No. Level 1 begins with plain element names, and each level has a help panel with the syntax, an explanation and examples. You build up one selector type at a time.

Which selectors does the game cover?

It moves from types, classes and IDs to descendant, child and sibling combinators, then pseudo-classes such as :nth-child, :only-of-type, :empty and :not(). The final levels use attribute selectors like ^=, $= and *=.

How do I start over?

Open the level menu in the top right and use the Reset Progress link at the bottom. That clears your saved level and all checkmarks.

Is there a penalty for wrong answers?

No. A wrong selector just makes the editor or items shake, and you can try again right away. Nothing is lost.

Try Something Different