After exploring various hover effects and techniques to display text on hover, I still haven't found the answer to my specific question.
My goal is to have an image with a transparent overlay that fades out on hover, revealing text in its place. It seems like a simple effect, but I can't quite figure it out.
I've created a JSFiddle to illustrate the effect I'm trying to achieve. It's a basic concept without transitions or images, just focusing on the desired outcome.
In summary, I'm wondering if there is a way to make a transparent overlay image fade out while simultaneously making text visible, using only CSS and no JavaScript?
.overlay {
position: absolute;
background-color: rgba(0, 0, 0, 0.8);
height: 150px;
width: 150px;
z-index: 1;
}
.overlay:hover {
position: absolute;
opacity: 0;
height: 150px;
width: 150px;
}
.lay {
color: #F0F;
position: absolute;
height: 150px;
width: 150px;
background-image: url('');
background-color: #FFF;
z-index: 0;
}
.lay:hover {
opacity: 1;
}