Ok so this is my trouble, I'm tryin' to declare the following CSS rule
div span > p span + p span {color: green;}
; Or rather said, select a descendant span
who is an adjacent brother of another span
(both two last spans
are descendant childs of a p
element) of who is in turn a direct child of another span
, but the most incredible of all this is that the rule div span> p span
"YES" takes it
Here the "I suppose" proper nesting CSS selectors and HTML code
div span > p span + p span {color: blue;}
<div>
<span>
<p>
<span>Item 1</span>
</p>
<p>
<span>Item 2</span>
</p>
</span>
</div>
` that is an immediate sibling *of the ``* that is a child of a `
– showdev Feb 26 '21 at 05:14`. In contrast, you want to select the `
` that is an immediate sibling of a `
` which contains a ``, not the `` itself. Unfortunately, there is not currently a way in CSS to select a parent that contains a specific child. See: [Is there a CSS parent selector?](https://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector)