It seems CSS is right associative, and unlike programming languages, you cannot influence this with parentheses.
I have this general structure:
<div>
<div class='pizza'></div>
</div>
<p>Select me! Select me!</p>
<div>
<div class="pizza">
<p>Do NOT select me!</p>
</div>
</div>
I can't figure out the selector for a <p>
that follows a sibling <div>
containing a <div class="pizza">
.
I tried this but the right-to-left associativity of CSS does not yield what I want:
div > div.pizza + p
I know this isn't right.
Can someone offer a pointer?
` elements, I would recommend adding a class to them, or to the parent element, so that you can use `.parent > p`
– TylerH Apr 20 '15 at 20:21