How to add active class to current element

Sorry if my description has errors because my description and English are not good.
I have created 2 div tags with the first div tag with class option and active, the second div tag is inside the first div with class shadow.

This is the shadow css displays outside the website
image

How to make the shadow class display its css when there are class options and actions like this
image

Sorry again that my description is a bit confusing. I just want to be able to do it like the 3rd image without having to use custom css in the div tag. Thank you very much!