I'm trying to make a div appear over an image using CSS "hover" event. But it's not working at all. Nothing happens at all... could you check what's going on? Thank you.
.over {
display: none;
opacity: 0.6;
background: #F58634;
font-family: Montserrat;
color: white;
padding: 20px;
width: 171px;
height: 114px;
z-index: 2;
}
.over:hover {
display: block;
}
.img {
z-index: 1;
}
And here is the HTML...
<td width="171px" >
<img class="img" src="./img/cat/_MG_7415.JPG" alt="" width="171px" height="114px">
<div class="over">
<table>
<tr>
<td>PESO</td>
<td>0,500gr</td>
</tr>
<tr>
<td>VALIDADE</td>
<td>60 DIAS<br><span style="font-size:5px;">APÓS DATA DE FABRICAÇÃO</span></td>
</tr>
<tr>
<td>CAIXA</td>
<td>5kg</td>
</tr>
<tr>
<td>TEMPERATURA</td>
<td>0 a 5ºC</td>
</tr>
</table>
</div>
</td>
So, I want the div class ".over" to overlay ".img" to show some information mouse is on the image. Is there anything I'm missing?
Thanks!
display:nonedoesn't display the element, so you can't hover over it. Usevisibilityinstead