Consider this html structure:
<p><a></a></p>
<div><a><img></a></div>
To hide all images inside a div
after a p tag
, you can use the following code:
p + div {display:none;}
However, attempting to show those hidden images by hovering over the anchor
inside the p tag
does not work with this code:
p > a:hover + div {display:block;}
If you simply use p
instead:
p:hover + div {display:block;}
it will make the images visible, but that may not be the desired behavior.
Is it because a
is a child of p tag
that the adjacent sibling "+" selector isn't working as expected?