CSS Diner
91–100 of 121 posts
Re: CSS Diner
#92Nice, I've been doing CSS for years but never knew about the "+" or "~" selectors until now. Anyone have any examples of how they have or would use these in real-life?
Re: CSS Diner
#93Re: CSS Diner
#94It 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 parti…
Re: CSS Diner
#95Re: CSS Diner
#96Nice, I've been doing CSS for years but never knew about the "+" or "~" selectors until now. Anyone have any examples of how they have or would use these in real-life?
:checked + label { background-color: green; }
http://jsbin.com/witaziwu/1/edit?html,css,output Small demo if you want to mess around with it.
Re: CSS Diner
#97Re: CSS Diner
#98Re: CSS Diner
#99This 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...
Re: CSS Diner
#100I'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's a good review for someone who's been exposed to them before.