Reputation: 24059
<li>
<img src="m.jpg">
<div class="img-data">img name</div>
</li>
Is it possible using just css to show .img-data on hover of the li? .img-data has opacity set at zero currently.
Upvotes: 2
Views: 1192
Reputation: 4418
Try this
ul {
list-style: none
}
.img-data {
opacity: 0
}
li:hover .img-data {
opacity: 1
}
<ul>
<li>
<img height="60" src="https://via.placeholder.com/350x150">
<div class="img-data">img name</div>
</li>
</ul>
Upvotes: 3