I was creating a simple effect for a webpage. I wanted to show an image when mouse is hovered on a link. The problem is, when I use <br>
tag, image is not shown on hover, but when I remove <br>
it works.
Can anyone tell me what is the issue here? Why does the <br>
obstruct the hover? Here's a snippet showing that <br>
is not working:
.imageClass{
display: none;
}
a:hover + .imageClass{
display: block;
}
<a href="http://esmartify.com/">Esmartify</a>
<br>
<!--When i remove this line, image is shown on hover, otherwise not-->
<div class="imageClass">
<img src="images6/concert.jpg" width="100%">
</div>
Here's a snippet showing it is working without <br>
:
.imageClass {
display: none;
}
a:hover + .imageClass {
display: block;
}
<a href="http://esmartify.com/">Esmartify</a>
<!--When i remove this line, image is shown on hover, otherwise not-->
<div class="imageClass">
<img src="images6/concert.jpg" width="100%">
</div>
` . My question was why is this behaving like this because of a
. Atleast Try to understand the question properly and then downvote. Have some sense while downvoting. – Ravi Shankar Bharti Oct 08 '16 at 17:23