I have a complex inquiry!
Let's examine three potential scenarios
Situation 1
<div class="entry-content">
<p><a href="#"><img src="#"></a></p>
</div>
Situation 2
<div class="entry-content">
<p> </p>
<p><a href="#"><img src="#"></a></p>
</div>
Situation 3
<div class="entry-content">
<p> </p>
<p>text</p>
<p><a href="#"><img src="#"></a></p>
</div>
The quantity of <p>
or other elements is not fixed. How can I target ONLY the first img to apply "display:none;"?
I assume I need to select .entry-content as the parent, but if I use img:first-child, it selects the <p>
element as the parent and would hide all images if there are multiple. That's why it should be more like the grandparent :D If using a language other than CSS is necessary, I am open to suggestions.