CSS :before on inline SVG

No, inline SVG is treated as an image, and images are replaced elements which are not allowed to have generated content.

Strictly speaking, I think it’s undefined. CSS 2.1 just talks about “images, embedded documents and applets” in general and The HTML standard defines it for images, but not SVG explicitly.

Leave a Comment