There are a whole bunch of CSS selectors available to web developers, but sometimes there's still not enough. I found this recently when building t...
For further actions, you may consider blocking this person and/or reporting abuse
Hi, after some test, i found an alternative solution (i think)
codepen.io/equinusocio/pen/NYpegd
That doesnβt do the same, notably the + combinator is the direct sibling, so if you throw another
<div>in the middle with a different class it breaks.Yes i know. But both solutions have caveats since even with the subsequent sibling the code will break if you use another element type (because you are bound to
typeof the element).BTW, nice exploration, thank you :)
Nice! We now have to wait the full support.
Well, full support for the latest
:nth-child(). You can definitely use the subsequent sibling selector for now.I mean lv 4 selector :)
I canβt wait either!
Great post Phil! This would have been perfect timing if released last week but none the less an great piece.
Replied to you on Twitter too, but wanted to re-iterate. I wish I written this a week (or more) ago too. It's been in my drafts for ages.
Glad you did sort it out yourself though!