120 comments

[ 5.6 ms ] story [ 122 ms ] thread
Couple things:

1. Would be nice to have some sort of 'hint' or 'solve' button.

2. Since you have the copy regarding how it's a work in progress, I'd suggest throwing a link to the github issues page so it's easy to submit bug reports and whatnot.

3. I like it. Really aesthetically pleasing to use and each level is such a small incremental step forward I think that even the most timid of noobs would get a kick out of using it.

> 1. Would be nice to have some sort of 'hint' or 'solve' button.

Did you see the CSS documentation on the right sidebar? It took me a while to notice it was there.

Yeah I did - but I ran into an issue on level 9 (A, B) where I wasn't producing the answer it was looking for but my solution was still technically correct.

I couldn't for the life of me 'unstick' myself from my initial answer. The hint could have kinda slapped my brain and jolted the more concise answer outta me.

Really minor detail I know, but with a lot of these online lesson helpers people do like to have the answer available to them.

Still trying to figure this one out..

Apparently "plate pickle, bento pickle" (or reverse order) isn't correct. Would love to see a hint/solution manual.

It's simpler than that. You are supposed to select the plate and bento, not the pickles on the plate and bento.
I was thinking plate + pickle and bento + pickle, since all of them were dancing... took me coming back here to figure out that only the plate/bento should be selected.
plate,bento does the trick, but because it's order-specific right now, so bento,plate fails - I'm updating it tonight to fix that issue.
I agree, I think I'll add a way to expose the solution. The problem with A,B is that it's also looking for one specific order, so I'll make sure both A,B and B,A work! Cheers!
This is really fun!
Level 13:

Select every pickle to the right of the bento

The solution `bento ~ pickle` passes, but I don't think it should. It does not select the pickles on the plates that are to the right of the bento.

I don't think it's meant to. The instructions are a bit ambiguous, but they mean just the pickles that are siblings to the bento, which you can see because only those are bouncing.
Absolute css genius. I've found no better way to learn selectors
I didn't like that apple:last-of-type, orange:last-of-type worked, but not orange:last-of-type, apple:last-of-type. Had me flummoxed for a bit.
Ya, I stopped there, thought it was broken (didn't realize how to get around that issue)
Similar thing happened to me with "pickle:last-child, apple:last-child"

The pickle and apple shook, but apparently I was "wrong."

Interesting... When I went through it quickly I think I used .small:last-of-type and never ran into this.
Yeah, my ah-ha moment happened when I realized that the pickles weren't small.
I know CSS pretty well and I have no idea how to make this work.

I'm on the current version of Chrome and it's throwing a load of JavaScript errors in the console so maybe that's got something to do with it.

Type in "plate" for level 1 - that's the correct selector. The goal is to type the correct CSS selector for each level into the strobing blue input. Also, use chrome or firefox :D
I thought it was a quiz game before noticing the explanation on the right. I guess to teach kids CSS basics this would be great, quite engaging.
I was flummoxed on how to start for a bit but after reading the darkened title, I realized that you're supposed to type a selector that matches the darkened title's description.

This looks great for teaching beginners CSS, although there should be an "instructions" message somewhere.

It took me at least 5 minutes to work out what to do. It is not immediately apparent you have to type in the selectors in the styling box, I thought you had to click on the animated objects. Pretty cool idea, I found it a little too easy, but as a developer already, maybe I am not the target market.

You did manage to throw in a few curve balls like needing to use general and adjacent sibling selectors to select particular elements beside other elements and inside of elements. I think it should get harder a lot quicker, would be cool to see an expert CSS version of this where it starts out hard.

Likewise. I kept typing ".plate", until I looked more carefully and realized there was a plate tag.

I can see this being used as a teaching tool.

I did exactly the same. Then I thought the error was that it needs '{' on the same line. The 'aha' moment is funny though.

What would be nice as a learning helper: having some display of what was actually selected with the last command. For example little hands displayed on top of the objects would somewhat match the theme.

If you select the right objects, they get lifted up in the air. If you select the wrong objects, they shake.
I see. My suggestion would be to keep the lift animation, but replace the shaking with something that is persistently visible as long as the selector hasn't changed - this way it would be much easier to make out what has been going on. Also, one could play around with different selectors before actually answering the question.
I'm not sure that making it harder faster is a good idea. It was easy for me as well (for the most part), but I immediately sent out an email to some friends who are trying to learn the web basics. A game like this is a fun way to teach them about css selectors- adding some specific notes about them in the email makes it a really easy lesson.
You can skip ahead, click three lines symbol on the top right and select an exercise.
This is really great. When first learning web design I would look up CSS selectors one at a time depending on what I needed at that moment. I assume this is how most people do it because all the tutorials out there are so damn boring, and by the time you learn the fifth selector you've forgotten the first. But even now, as someone who's proficient in CSS I enjoyed completing a large chunk of this "tutorial". If I didn't already have a whole lineup of side projects I'm working on I'd try making this mobile friendly and packing it into an app. If there were more levels that got very difficult at the end it would be a fun way for people learning web design (a growing trend) to spend their time while commuting.
Took a while to understand what the game was asking for, but once I did it was a lot of fun! Will definitely recommend it to friends learning css.
Really cool, but please, more contrast. I can barely read the text in the HTML/CSS editor.
I'm not clear what to do about the game.Could someone give me the solve for level 1 for example.thx
take a look at the console.

>Fails thus far: 5

I really enjoyed this, but as others have mentioned it is not immediately clear what you're supposed to do. I spent about 3 minutes trying to figure it out. Maybe the first level should tell you exactly what to type, so that you can get the hang of it.
very cool, but it took me longer than it should have to figure out how to play.
Quite a bit of fun.

One notable issue: several puzzles need to have additional elements or classes added to prevent less sophisticated solutions from working. It's often possible to use a simpler selector than the one being taught in a particular puzzle.

Hey can you give me a specific example that's bothering you?
Some examples: `plate>apple, plate>pickle` for 16, `apple, pickle` for 17, `bento:nth-child(2)` for 19, `plate:nth-child(2)>apple` for 22.
One example of how it should work: On puzzle 1, the expected solution is "plate", but * works fine; that's completely OK because puzzle 2 forces you to use a more specific selector.

On level 7, it's possible to ignore the intended lesson and use "plate .small, bento .small".

On level 10, surprisingly, it's not possible to ignore the intended lesson and write "apple, orange, bento, plate".

On level 11, .table * * works, though that does use the intended lesson.

That's in addition to the ones already mentioned in the sibling comment, which were the first ones I noticed.

I did several of them this way as well. At first I wasn't even reading the description to the right and just typing in selectors based on the instructions. So if I knew two comma separated selectors would work then that's what I typed in. Without going back over it to check, it's possible I entered selectors on a good number of them totally different than what was expected.

It would be interesting if the answers were tracked so we could eventually see what different developers were entering as selectors on each one.

Quite fun. I was typing in the correct answer for the first puzzle, but with a "{ }" at the end and it marked me incorrect. Maybe pop up a warning to tell the user not to type braces?
There's an opening brace on the next line that could probably be more obvious.
Very cool. A suggestion: move the help bar (that teaches the concepts) to the left side. I think it will feel more natural there. It took me some time to notice it. Do you plan to extend that to learning javascript too? That would be really nice.
This is great. I never knew about the universal selector (*) or the general sibling selector (~). I'm sure I'll learn a few more tricks from this as well, not finished yet.
Google[0] and Mozilla[1] both have some information on their developer sites about why avoiding the universal selector is preferable from a performance point of view.

I'm yet to find a case that has absolutely required the use of the universal selector. Has anybody else?

[0] https://developers.google.com/speed/docs/best-practices/rend...

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_s...

I mostly see the universal selector used for resets (like removing all padding and margins), but it's definitely not frequently used.
Brilliant. I have been doing a little bit of CSS over the years and I can get what I need done albeit not as quickly as some frontend developer that has every quirk of IE6 memorised. Since I generally do backend stuff sometimes I put in an extra class, e.g. for the end of a list, just 'to make it easier' on the CSS side of things. There are things like A+B that I steer clear from as they are allegedly bad according to tools like 'ySlow'. So I have plenty to learn when it comes to CSS selectors. Normally I look at the CSS and the HTML, not the big picture beyond 'inspect element'.

I felt that CSS Diner is very useful even if you think you know your subject. The graphics are great. I wish all education was as much fun and as interactive.

Like many folk here I did not understand what the game was at step #1 although I forgot this at step #2. So yes, some introduction needs to be worked on even though it is easy to overlook that once you get 'absorbed'. Aside from that, brilliant and bookmarked.

On an iPad I long-tapped one of the plates and the highlight animation got really funky.
This is amazing, literally the best way I've ever seen for teaching about CSS selectors. I'm very grateful you made this open source so more levels and features can be added.
This is great. Although, at first I thought it was one of those codepen CSS creations.

For # 16, I tried the following which did not work:

  pickle:only-child, apple:only-child
However, this worked:

  apple:only-child, pickle:only-child
I thought the solution was

  plate :only-child
That works, along with just

  :only-child