Here is the CSS code that specifically targets the child element "#overlay" when its parent, ".collection", is being hovered over:
.collection {
position: relative;
overflow: hidden;
}
.collection:hover #overlay {
position: absolute;
opacity: .3;
}
And this is the corresponding HTML:
import styles from "./Home.module.css";
<div className={`${styles.collection} card`}>
<div id="overlay"></div>
</div>
However, it seems that the properties are not being applied to the child element when the parent is in hover state.