TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

CSS Diner

560 点作者 dtournemille大约 11 年前

66 条评论

DigitalSea大约 11 年前
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.<p>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.
评论 #7465030 未加载
评论 #7462985 未加载
评论 #7472476 未加载
Theodores大约 11 年前
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 &#x27;to make it easier&#x27; 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 &#x27;ySlow&#x27;. 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 &#x27;inspect element&#x27;.<p>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.<p>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 &#x27;absorbed&#x27;. Aside from that, brilliant and bookmarked.
shittyanalogy大约 11 年前
Very cool.<p>Possible bug: on level 19, :nth-last-child() doesn&#x27;t seem to work for selecting the first child in a set of children in firefox. Running<p><pre><code> $(&quot;bento:nth-last-child(2)&quot;).length </code></pre> is coming up 0 in the console as well.<p>edit: these work though :&#x2F;<p><pre><code> bento:nth-last-child(even) bento:nth-last-child(1n+2) bento:nth-last-child(2n+0) </code></pre> edit 2: Ahh figured it out. :nth-last-child doesn&#x27;t match only nodes that satisfy the selector you called it on. It matches all sibling nodes of the selector you called it on.<p>edit 3: Actually, I don&#x27;t know what I&#x27;m doing. It might be a bug. I can&#x27;t tell anymore. Anyone else have any thoughts?<p>edit 4: OK, I finally get it... <i>nth-last-child()</i> is a qualifier not a grouper(I don&#x27;t know the actual css terms so I made those up). That is to say that when you specify <i>bento:nth-last-child(2)</i> you&#x27;re not saying &quot;of all the bentos give me the second one&quot; you&#x27;re saying &quot;of all the bentos give me those that are in the second child position.&quot;
评论 #7464259 未加载
评论 #7464446 未加载
评论 #7467087 未加载
primitivesuave大约 11 年前
This is amazing, literally the best way I&#x27;ve ever seen for teaching about CSS selectors. I&#x27;m very grateful you made this open source so more levels and features can be added.
JoshTriplett大约 11 年前
Quite a bit of fun.<p>One notable issue: several puzzles need to have additional elements or classes added to prevent less sophisticated solutions from working. It&#x27;s often possible to use a simpler selector than the one being taught in a particular puzzle.
评论 #7464012 未加载
matthuggins大约 11 年前
Cool, but it&#x27;s definitely got some issues. For example, this failed:<p><pre><code> orange:last-of-type, apple:last-of-type </code></pre> while this worked:<p><pre><code> apple:last-of-type, orange:last-of-type</code></pre>
评论 #7464010 未加载
评论 #7463464 未加载
评论 #7463546 未加载
评论 #7464269 未加载
smokinjoe大约 11 年前
Couple things:<p>1. Would be nice to have some sort of &#x27;hint&#x27; or &#x27;solve&#x27; button.<p>2. Since you have the copy regarding how it&#x27;s a work in progress, I&#x27;d suggest throwing a link to the github issues page so it&#x27;s easy to submit bug reports and whatnot.<p>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.
评论 #7462556 未加载
wrl大约 11 年前
It is really bugging me that I can&#x27;t prefix &quot;.table&quot; or &quot;div.table&quot; to any of these, since intuitively that&#x27;s what I&#x27;d do when writing styles.
评论 #7467203 未加载
tyleregeto大约 11 年前
I can always tell when a designer is working on a large screen, this feels very awkward on my 13 inch laptop. There is just a little too much vertical height. I keep wanting to scroll to see the whole thing. Very nice idea though, well done!
yeldarb大约 11 年前
Nice, I&#x27;ve been doing CSS for years but never knew about the &quot;+&quot; or &quot;~&quot; selectors until now.<p>Anyone have any examples of how they have or would use these in real-life?
评论 #7464034 未加载
评论 #7465125 未加载
评论 #7464939 未加载
评论 #7464574 未加载
mbesto大约 11 年前
Amazing.<p>Here&#x27;s the GitHub repo in case anyone wants it:<p><a href="https://github.com/flukeout/restaurant" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;flukeout&#x2F;restaurant</a><p>(couldn&#x27;t find a link anywhere)
coffeecodecouch大约 11 年前
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&#x27;ve forgotten the first. But even now, as someone who&#x27;s proficient in CSS I enjoyed completing a large chunk of this &quot;tutorial&quot;. If I didn&#x27;t already have a whole lineup of side projects I&#x27;m working on I&#x27;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.
Oculus大约 11 年前
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.
muxxa大约 11 年前
Super idea and execution! I think it needs a few more iterations in a teaching environment to actually make it <i>effective</i> though. I tried running this by someone with absolutely zero css or html experience.<p>- The instruction (e.g. &#x27;Select the small apples&#x27;) isn&#x27;t noticeable enough.<p>- There needs to be a pause after you get an answer right, so you can work out <i>why</i> you got it right (otherwise you can bang away at random combinations until you get to the next step without any idea what worked).<p>- Similarly, when you try a wrong answer, there needs to be feedback as to <i>why</i>. E.g. if you try &#x27;bento small plate&#x27;, when the answer is &#x27;bento #small plate&#x27;, then there needs to be an explanation as to what you <i>didn&#x27;t</i> do. This is not trivial to achieve!<p>- The instructions at the right hand side is visually noisy, and should be hidden until needed, or perhaps presented first (in a modal popup) to give the visitor a heads up as to what they are supposed to be adding to their knowledge.<p>- Because of the right hand instructions, it&#x27;s not initially clear that the HTML code is at all part of &#x27;the puzzle&#x27;.<p>You are 90% there, just the last 90% to make it a true gem of a teaching tool.
reshambabble大约 11 年前
Like what you&#x27;re trying to do here!<p>It took me some time to figure out what I needed to do. Immediately, when I see &quot;select,&quot; I think &quot;click,&quot; so I clicked on the item instead of typing in text. Consider saying, &quot;select images by typing in their class below.&quot;<p>Instead of &quot;.classname,&quot; give an example. Also consider a pop up tutorial or a guide that shows you what to do on the very first lesson.<p>The list of lessons is also confusing. There needs to be something that says - this is what you&#x27;ve learned and what you still have to learn. Otherwise it just looks like a strange list of words from a language I don&#x27;t know.<p>Also - consider putting the instructions on the left hand side, and putting &quot;Learn CSS!&quot; or something at the top instead of &quot;Select ???.&quot; Because I read from left to right, right now I see the image first, an instruction to select something on the image (which I and others will interpret as &quot;click on the image&quot;) and then I stop (rather than go all the way across to see the other instructions). If I see the instructions first and know exactly what to do.<p>Great job on this!
TazeTSchnitzel大约 11 年前
I didn&#x27;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.
评论 #7462833 未加载
评论 #7462934 未加载
评论 #7462717 未加载
kaplejon大约 11 年前
What an incredibly pleasant treat. Fun with smart progression. This certainly brought a smile to my face.<p>But what I liked most, is that as someone with very little experience in writing CSS, this allowed me to breeze through the simpler selectors, while building my confidence on the more complex selectors. No doubt the graphical representation was extremely helpful in that regard.<p>A resource worth sharing.
jmcgough大约 11 年前
Really nice job - I like the vibrating items to give you feedback on what your attempt selected.<p>I&#x27;m not sure if a beginner will retain much by going through each selector for each level - would be nice to throw in some levels that require you to think back to previous selectors. However, it&#x27;s a good review for someone who&#x27;s been exposed to them before.
dav-大约 11 年前
I really enjoyed this, but as others have mentioned it is not immediately clear what you&#x27;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.
xtacy大约 11 年前
Quite fun. I was typing in the correct answer for the first puzzle, but with a &quot;{ }&quot; at the end and it marked me incorrect. Maybe pop up a warning to tell the user not to type braces?
评论 #7463083 未加载
mpnordland大约 11 年前
Absolute css genius. I&#x27;ve found no better way to learn selectors
joeframbach大约 11 年前
Level 13:<p>Select every pickle to the right of the bento<p>The solution `bento ~ pickle` passes, but I don&#x27;t think it should. It does not select the pickles on the plates that are to the right of the bento.
评论 #7463653 未加载
评论 #7463648 未加载
rschmitty大约 11 年前
This is very cool. I found you can cheat though depending on the table and task. For example level 17 is trying to show you :last-child but you can &#x27;cheat&#x27; and just do `apple, pickle` and it let&#x27;s you move on to the next phase<p>Anyways, very awesome way to teach, I&#x27;m sharing it with all my friends but would be cool to force the solution and prevent &quot;hacks&quot; :P
subrat_rout大约 11 年前
It is a really neat game. Kudos to maker(Luke). One must possess a unique combination of creativity and subject matter expertise to bring this kind of engaging game to audience(users). I heartily encourage those makers and wish for more games on other programming languages (such as Rails, HTML and Javascript etc).<p>Does anybody know other games like this in HTML, Javascript and Rails?
dfritsch大约 11 年前
What should the solution to Level 19 be? I couldn&#x27;t get anything with &#x27;nth-last-child&#x27; to work for me.
评论 #7464105 未加载
owenversteeg大约 11 年前
I was flummoxed on how to start for a bit but after reading the darkened title, I realized that you&#x27;re supposed to type a selector that matches the darkened title&#x27;s description.<p>This looks great for teaching beginners CSS, although there should be an &quot;instructions&quot; message somewhere.
ntaso大约 11 年前
I think it&#x27;s great and fun but too easy. There should be levels that require more nesting or specifying elements within another group and there should be more &quot;control groups&quot; that should NOT be matched (like in regex golf).<p>e.g.: A + B &gt; C .small
aaronetz大约 11 年前
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.
tarun29061990大约 11 年前
Not able to figure out what to do. It should be simpler, Kindly put a note or some sort of information about what to do , don&#x27;t put a link because I think there are more chances that the user will go away rather than playing with it.
_august大约 11 年前
This is great. Although, at first I thought it was one of those codepen CSS creations.<p>For # 16, I tried the following which did not work:<p><pre><code> pickle:only-child, apple:only-child </code></pre> However, this worked:<p><pre><code> apple:only-child, pickle:only-child</code></pre>
评论 #7463457 未加载
enscr大约 11 年前
Well done. A little &#x27;getting started&#x27; would help people get started faster. This written at the top &quot;Select the plates&quot; &amp; the progress bar weren&#x27;t obvious because there were occluded form the view.
colinramsay大约 11 年前
I know CSS pretty well and I have no idea how to make this work.<p>I&#x27;m on the current version of Chrome and it&#x27;s throwing a load of JavaScript errors in the console so maybe that&#x27;s got something to do with it.
评论 #7464075 未加载
robobro大约 11 年前
This was fun. It reminds me a lot of Regex Crossword[1]. Good game for people who need to brush up on that.<p>[1] <a href="http://regexcrossword.com/" rel="nofollow">http:&#x2F;&#x2F;regexcrossword.com&#x2F;</a>
habosa大约 11 年前
This is great. I never knew about the universal selector (*) or the general sibling selector (~). I&#x27;m sure I&#x27;ll learn a few more tricks from this as well, not finished yet.
评论 #7463621 未加载
rowyourboat大约 11 年前
Web designers should be forced to use el cheapo LCD monitors. Dark grey text on black and light grey text on white are really hard to read if you do not have a very good monitor.
eiliant大约 11 年前
Thanks! Great design and interactivity. I would suggest adding a glossary page somewhere and some follow up at the end instead of just CSS God, maybe suggested readings?
rahmatawaludin大约 11 年前
Why don&#x27;t you use strawberry? I love strawberry.. :)
vysakh0大约 11 年前
This is really useful and fun to use. At first I din understand how to solve the problem, then realized the plate is related to the puzzle. Great work!
slaxman大约 11 年前
This is awesome! I wish this was there, when I started learing to code. I found it really difficult to understand CSS selectors back then. Great job!
NKCSS大约 11 年前
I have found two bugs;<p>Level 17 of 26: Select the small apple and the pickle<p>Does not accept .table &gt; :last-child, apple.small<p>does accept<p>apple.small, pickle<p>Level 19 of 26: Select the 1st bento:<p>Does not accept .table &gt; :nth-last-child(4)<p>does accept: bento:first
xixixao大约 11 年前
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.
cheshire137大约 11 年前
Awesome! I shared this with my ladies&#x27; coding class, since several of them are interested in web design and have been learning CSS.
the4dpatrick大约 11 年前
I wanted to share after I completed it, and I was completely expecting a share link after I finished it all. Make it easier to share
tripzilch大约 11 年前
Oh wow. I teach kids to make websites (and other computer stuff) and I&#x27;m totally going to use this game.<p>Thanks for creating it!
j-rom大约 11 年前
Wow. Thank you for this. I&#x27;m just starting out in web development and this makes learning CSS a lot easier.
changyu大约 11 年前
I&#x27;m not clear what to do about the game.Could someone give me the solve for level 1 for example.thx
评论 #7463727 未加载
riz_大约 11 年前
Really cool, but please, more contrast. I can barely read the text in the HTML&#x2F;CSS editor.
jebblue大约 11 年前
This is pretty slick, I usually do just basic CSS, this got me to see the power of selectors.
danoc大约 11 年前
Really well done. I&#x27;d love to see one of these teaching the CSS animations they use.
评论 #7463707 未加载
zacinbusiness大约 11 年前
On an iPad I long-tapped one of the plates and the highlight animation got really funky.
rplnt大约 11 年前
Does not work in Opera (the normal one) at all. The plates are jumping like crazy.
asadlionpk大约 11 年前
you should put up little help message to tell what exactly the player has to do. Took me few minutes to understand that I had to type in the css selector.
agumonkey大约 11 年前
Made me learn a few, thanks for the fearning.
gulbrandr大约 11 年前
&gt; You did it! You are a CSS God.<p>Very good, thank you! :)
durkie大约 11 年前
absolutely love it. thanks for the creative way of teaching css -- it&#x27;s very well done!
bostan大约 11 年前
awesome game. I think it will be great if you could add some levels for layouts.
klochner大约 11 年前
there&#x27;s a bug in level 9 - you&#x27;re enforcing an order on the tags<p>overall this is great
Kiro大约 11 年前
How do you do level 26?
评论 #7465686 未加载
neotrinity大约 11 年前
godsend! i am learning css and this turns up on hacker news
hitherejoebirch大约 11 年前
This is really nice!
dbecks大约 11 年前
This is really fun!
akbarnama大约 11 年前
Awesome work!!
hw大约 11 年前
this is fun. Love educational games.
mrtksn大约 11 年前
take a look at the console.<p>&gt;Fails thus far: 5
iotakodali大约 11 年前
cool. thnx for making this
chadscira大约 11 年前
very cool, but it took me longer than it should have to figure out how to play.