I have text that should fade in on hover and fade out when the mouse leaves the bounding box. For that I used the following CSS:
.project h3 {
/* Other styles */
opacity: 0; /* Set the default opacity to 0 */
}
.project:hover h3 {
opacity: 1; /* Set the opacity to 1 when hovered over */
transition: opacity 0.3s ease; /* Add a smooth transition for the opacity change */
}
.project:not(:hover) h3 {
transition: opacity 0.6s ease; /* Add a slower transition for the opacity change when not hovered over */
}
When I load the page, I want it to be invisible from the start, but right now it starts opaque and fades out immediately. ChatGPT keeps suggesting to just remove the ".project:not(:hover) h3" style and is driving me insane. How can I keep the fade-out when I move my mouse away and still have it be invisible from the start?
The html context is literally just a div with the class "project" and that h3 in it, i created a separate test project to strip it down, the problem persisted.