I want to change "mom" bg color to a different color when the "winlink" img is present in the "secondkid" div (it won't always be present).
Is there a way to do this with css or do I need more involved code?
I've tried using class selectors but can't seem to change more than the border around the image itself, not the whole div (I don't know how to reference "mom" div when checking the "secondkid" div) [title~="Thisimg"]{. border: 5px solid yellow; }
<div class="mom">
<div class="firstkid">
<img class="blah.gif" alt="Nope!" title="Woe!">
</div>
<div class="secondkid">
<a href="somelink.html">
<p class="images">
<img src="winlink.gif" alt="Thisimg!" title="Thisimg"></p>
</a>
</div>
</div>