:before pseudo-class 会影响 SVG 中的 tspan 吗?

Does the :before pseudo-class affect tspan in SVG?

我可以在 SVG tspan 元素中使用 :before CSS 伪元素吗?

具体来说,我正在尝试在 SVG 中制作超棒的字体,而不必像 here 解释的那样重新编码所有字符,而只是将正确的 class 添加到元素。

换句话说,我希望能够做到这一点:

<tspan
   class="fa fa-meetup"
   x="12.70"
   y="17"></tspan></text>

看看它是否有效。

可以将 SVG 作为背景添加到伪 class,避免与 SVG 发生任何冲突 post:

Is there a way to use SVG as content in a pseudo element :before or :after

因此,与其尝试将 FontAwesome class 用作元素上的选择器,您可以将 i 元素设置到您需要的任何位置,并补偿加载的背景 SVG英寸

并回答您的评论 - 您需要将 FA 编码为新的 classes 以使其按您要求的方式工作,因为 FontAwesome 默认使用 i。它会像这样工作:

.your-class {
   content: "/f121";
}