This is the css that targets the child element, "#overlay", when the parent, ".collection", is hovered.
.collection {
position: relative;
overflow: hidden;
}
.collection:hover #overlay {
position: absolute;
opacity: .3;
}
This is the html:
import styles from "./Home.module.css";
<div className={`${styles.collection} card`}>
<div id="overlay"></div>
</div>
The properties are not applied to the child element when the parent is hovered.