I have HTML like this:
<div class="parent">
<div class="thumb">...</div>
<div class="text">...</div>
</div>
I want the background of the "text" div to be white. But ONLY if there is no "thumb" div preceding it since that div won't always be there.
I realize I can do something like this:
.parent .text {background-color: #fff;}
.parent .thumb + .text {background-color: transparent;}
So color ALL the text backgrounds white and then override the ones that have the thumb div preceding it.
But I was wondering if it's possible to do something like:
.parent :not(.thumb +) .text {background-color: white;}
To kill two birds with one stone by only targeting the "text" div when there is no preceding "thumb" div. Any ideas?