Why don’t :before and :after pseudo elements work with `img` elements? [duplicate]
The spec says… Note. This specification does not fully define the interaction of ::before and ::after with replaced elements (such as IMG in HTML). This will be defined in more detail in a future specification. I guess this means they don’t work with img elements (for now). Also see this answer.