I don’t think this is possible, but I’m hoping to be proven wrong.
Given this html:
<div class='foo'>
<div class='bar'></div>
<div class='foo'></div>
</div>
Is it possible to write a selector to match just the second child div, based on it having the same class as its parent?
Note: I know how to write a selector for the second div for this example html, my question is whether you can capture my class is the same as my parent’s class with some kind of css magic.
Only if you know the name of the class:
No. (Maybe with LESS or SASS, but I’m not sure).