I’m trying to make a webpage where when the user hovers over the text, an image appears. I found a working code, but it showing as a link and I don’t want it to. My idea is to have a list of items and when the user hovers over each one, a new image appears.
.hover_img a { position:relative; }
.hover_img a span { position:absolute; display:none; z-index:99; }
.hover_img a:hover span { display:block; }
<div class="hover_img">
<a href="#">flippe flute<span><img src="//picsum.photos/200?c=1" alt="image" height="200" /></span></a><br>
<a href="#">pottery flute<span><img src="//picsum.photos/200?c=2" alt="image" height="200" /></span></a>
</div>
2
Answers
replace the
a
tags withdiv
tags, like thisYou can use the same code as the question with few changes mentioned in my code. No need to use div for it. Just you have to style it the way that it looks like a list items.
Hope it fulfils your requirement.
Thanks