Home › Forums › CSS › show image when hovering over menu item › Reply To: show image when hovering over menu item
November 23, 2016 at 10:33 am
#248177
Participant
My hosting’s been down so my code tendencies had to be redirected anyway. Tom’s example was actually pretty much what is needed, with a few adjustments.
<li class="submenu">
<a href="//www.google.com" target="_blank">
<img src="http://lorempixel.com/70/70/">
</a>
</li>
.submenu {
width: 150px;
height: 70px;
position: relative;
background: grey;
}
a {
display: block;
height: 100%;
}
img {
position: absolute;
top: 0;
left: 100%;
display: none;
}
.submenu:hover img {
display: block;
}
Where li
is any of the submenu items that have a nested link. Assuming the image should end up to the right of the list.