Can someone help me achieve a light black overlay on an image when hovering over it, just like the text does in this code snippet? I'm new to CSS and HTML and any assistance would be greatly appreciated!
Here is the sample code:
<div id="con">
<div id="box1">
<p id="text1">
<a href="url">DESTINATIONS</a>
</p>
</p>
<p id="text2">
AMALFI<BR>SORRENTO<BR>POSITANO</a>
</p>
<p id="text3">
<a href="url">THINGS TO DO</a>
</p>
</p>
<p id="text4">
TOURS<BR>MUSUEMS<BR>SHOPPING</a>
</p>
</div>
CSS Code:
#con {
width:1024px;
height:670px;
background-color: #161717;
}
#box1 {
float: left;
font-size: 25px;
width: 388px;
height: 477px;
background-image: url(media/trying1.png);
background-size: cover;
margin-left: 120px;
margin-top: 90px;
}
#text1 {
z-index:100;
color:white;
font-size:30px;
text-align: center;
margin-top:80px;
line-height:55px;
opacity: 0;
transition: all 0.5s;
}
#box1:hover #text1 {
opacity: 1;
}