I am creating some elements dynamically using jquery. (say with identifier test_element1 , test_element2 , etc.)
I have below CSS -
div[id^=test_]:before { content: ""; height: 100%; width: 100%; box-shadow: #aaaaaa 0px 0px 10px inset; position: absolute; left: 0px; top: 0px; z-index: -1; }
The ::before element is not displayed when checking an element. It appears only if test_element1 already present in my HTML (i.e. static content).
How to do ::before for my dynamic elements?
source share