30-seconds-of-interviews icon indicating copy to clipboard operation
30-seconds-of-interviews copied to clipboard

Question on CSS sibling selectors is partially wrong

Open jkemming opened this issue 6 years ago • 1 comments

The question css-sibling-selectors seems to give a partially wrong answer.

As per W3C spec, the ~ (tilde) combinator does not work the way it's described in the answer. Instead, it's almost the same as the + combinator except that the element following the combinator doesn't have to be placed immediately after the one before the combinator.

On a side note, the W3C seems intent on changing the combinator names, in fact this appears to have happened already in the currently active level 3 spec. The general sibling combinator (~) was renamed to subsequent-sibling combinator and the adjacent-sibling combinator (+) changed to next-sibling combinator. One might consider using these names as well.

jkemming avatar Mar 19 '19 18:03 jkemming

@jkemming seems like a great and easy PR to me 😉

skatcat31 avatar Apr 08 '19 02:04 skatcat31