Here's my HTML:
<div class="parent">
<div class="thumb">...</div>
<div class="text">...</div>
</div>
I need the "text" div background to be white, but only if there is no preceding "thumb" div.
I could use this CSS:
.parent .text {background-color: #fff;}
.parent .thumb + .text {background-color: transparent;}
This sets all text backgrounds to white and then changes those with a thumb div before it. But I'm wondering if I can simplify it like this:
.parent :not(.thumb +) .text {background-color: white;}
This way, the style only applies to the "text" div when there is no preceding "thumb" div. Any thoughts?