I want to create this effect:

![enter image description here](https://i.stack.imgur.com/7XnQu.jpg)

Is there a way to do this via CSS/JS?

Thanks so much I'm a newbie in web design and I've been struggling with this for the past hours!