Is there a way to execute all combinations of selectors without writing them one at a time?
Let's say I want font-size: 30px;in the second element, and any element can be a, bor span.
I would usually write:
a + b, b + a, a + span, span + a, b + span, span + b {
font-size: 30px;
}
But this leads to combinations n*(n-1)!
I am looking forward to something like this:
{a,b,span} + {a,b,span} {
font-size: 30px;
}
Although, if there is no alternative, let me know if the best choice is to always ensure that the contained elements are always the types that I want, so I can use *:
* + * {...}
A CSS solution, if possible, or SCSS, if it results in a cleanup or the only unique solution possible.
Edit:
nth-child. , ( , , ).
div , . :.
<div class="text">
<span>The weather</span> <i>is</is> <img src... /> <b>nice</b> <span>today</span>
</div>
, , <div class="whatever">, div . , - { span, i, b } .