I was avoiding any specifics to the quiz in case any one was trying it out but I take your point.
I was only playing devils advocate and if you remove the background from my post there appears to be no overlap but adding the background shows an overlap. It’s another misunderstood part of CSS and would have been good as a separate question
In my eyes it’s narrowed down to 2 results instantly (ok technically 3 but that 3rd one has obviously less specificity) which is then left to specificity to determine the winner.
The page will automatically insert <tbody> into the page (if not present already) so no matter what table>tr is IMPOSSIBLE. Invalidating that entire option.
The last is the most specific and, if not for the browser inserting a THEAD element, would be selected.
Perhaps this should be a separate thread, but …
Are there a lot of variances from one browser to another in specificity?
Specificity seems to be pretty clear http://www.w3.org/TR/css3-selectors/#specificity
tbody*
But it isn’t inserted, thus this option cannot be considered as an option. You’re correct though it WOULD be selected if not for the browsers inserting tbody. That fact alone though makes that option invalid. If the last option started with “tbody” instead of “table”, then yes that would win out. But it doesn’t .
table>tr will never select anything since in no possible universe will the browser not insert <tbody> before any rows.
3/3 of those questions in article and 100% on CSS Core on the first try. Some questions were a bit tricky Nice quiz overall: with careful reading and understanding there were no ambiguities.
Regarding ideas for more tricky questions: I have some, but most of them won’t fit into the format with the number of predefined answers (and I’m not that good at coming up with false answers, haha). But, one of my favorite questions: “When the styles of siblings can have an impact on the position of the absolute positioned element?”
92% on the html one first try. Both html and css quizzes done in less than 15 minutes. Even though the answers aren’t posted, there is a lot of benefit to be gained from these quizzes. Great remedy for the “Imposter Syndrome”, especially if you are a full-stack free-lancer and have no way of gauging if you are keeping up with the industry on average. Plus they are a lot of fun.
I just have to say I didn’t assume that :hover was a pseudo-element, I was thinking that I’d apply a pseudo-element TO the anchor on :hover to create the shadow, which seems like a perfectly valid scenario. So I think that question should be re-evaluated, or at least consider re-wording or replacing that particular answer. :^)
I’m not sure I understand. A pseudo-element is a piece of content that doesn’t correspond to an actual HTML element; I’m not sure what you mean when you say you’d apply a pseudo-element to the anchor. Do you mean you would target a pseudo-element (such as :before or :after) of the anchor?
I’d say that’s a poor choice of words on the author’s part. Combinators like > and + certainly do cause a selector to target a smaller subset of elements in the page than the selector would without them, and in that sense they are more ‘specific’, but they do not contribute to the Specificity (with a capital ‘S’, meaning the formal ranking of CSS selectors that determines the order in which rules are applied to the document) of a selector.
Kevin Yank himself is a perfectly fallible human being, and I do share your trust issues. Writing good multiple choice questions is really hard, because for every correct answer you have to come up with four incorrect answers (the technical term is ‘distractors’) that aren’t obviously wrong but are actually wrong.
We’re actually in the process of adding support for fill-in-the-blank questions to Sit the Test, in part because it makes writing good test questions a lot easier!
Hmm. I’d argue that the semicolon is clearly optional whereas all the other options are not. Still, I do agree it could be clearer. I’ve adjusted the wording to “Which part of this code can be removed without breaking it or changing its effect?”
Indeed, he did not! I’ve deleted this question from the test and will devise a suitable replacement. Thanks for the catch (and the awesome piece of CSS trivia!).