In the following HTML, I want to apply a hover effect to the header h2, upon hover of the image img. Is there a css selector to do that, or another
h2
img
There is actualy no way to do it in pure CSS.
But, you could simply do the following :
Title
And then apply the :hover effect to the a tag.
a
Another way will be with some javascript. For example, with the jquery selector .closest()
.closest()