I'm editing a CSS class that alters hyperlink (a
) elements. But I want those elements which contain images (img
) to be ignored on that class.
This is an example of the current structure of my HTML:
<div class="myDiv">
<a href="foo"> <!-- no class -->
<img src="foo"> <!-- no class -->
</a>
<p></p>
<a href="bar">TEXT</a> <!-- no class -->
</div>
I can't change the HTML structure and I can't guarantee that the second hyperlink element will be always the second.
I want to alter only the one who have just plain text.
How can I do that?