Pseudo-elements and images
Can an image have pseudo-elements?
In my testing I have not been able to use :before or :after with image elements, but I would love some more information.
EDIT: W3C 开发者_C百科isn't clear either unfortunately:
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.
It wouldn't really make any sense. The :before and :after insert the extra content inside the matched element, and img doesn't have an inside.
精彩评论