Often I want to style an element AND its younger siblings. Suppose I want to style the third
and all following ones. I know that I can do this:
span:nth-child(2) ~ span
In English, this says "get the second
and style all following
ones". So this effectively does style from the third
But I don't like this syntax, because:
- I have to read this carefully every single time, because it's not easy to understand.
- If I change the HTML to use a
instead of a
, I have to change the corresponding CSS in two places.
So, is there any way, possibly using a LESS function or mixin, to do the equivalent of: