I’m trying to implement this. I have the box div, and box:after pseudo element. I want the pseudo element to be on thop of the box div.
Why does not this work?
transform: translate(5px, 5px);
You need a
content property for your
For me, adding:
content: ''; worked just fine.
I’ve never used these selectors, so I’ve been doing some reading since I saw your post. Here is a quote from a Smashing Magazine article on pseudo elements that supports what I found, you have to have a content property:
Secondly, without the content property, which is part of the generated content module in the specification, pseudo-elements are useless. So, while the pseudo-element selector itself is needed to target the element, you won’t be able to insert anything without adding the content property.
Article is here: