Hello,
I'm trying to select a first element of class 'A' in an element with id or class 'B'. I've tried a combination of > + and first-child selectors, since it's not a first element inside class element 'B'. It worked, but ... i'm trying to override some default css and i have no control over the server side and it seems that the class 'A' element is sometimes generated in a different position. Here's an illustration:
<class C>
<class B> might have a different name
<some other classes> structure and element count might differ
<class A></class A> our target
<class A></class A> this shouldn't be affected
<class A></class A> this shouldn't be affected
</class B>
</class C>
Sometimes the name of the class 'B' differs and the elements before 'A' differ as well. So is there any way to select the first occurence of 'A' in an element 'C'? Because class 'C' is always there. I can't use + > and first-child selectors since the path to first 'A' element differs, but element 'C' is always there and it would be a nice starting point.
Thanks for the help