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 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With