【问题标题】:Using CSS to manipulate a SVG added with ::before pseudo-element?使用 CSS 操作添加 ::before 伪元素的 SVG?
【发布时间】:2016-05-13 13:19:52
【问题描述】:

我用最常见的方式用 SVG-image 替换了一个复选框按钮:

[type="checkbox"] + label:before {
    content: url("data:image/svg+xml,<svg ...> ... </svg>");
    /* Some more styling */
}

有什么办法,例如,我可以用 CSS 定位我的 SVG 路径来更改它的填充?可能不会,但是...

提前致谢!

【问题讨论】:

    标签: css svg css-selectors


    【解决方案1】:

    您不能使用 CSS 选择器定位 ::before 伪元素的内容,也不能从其主文档中定位嵌入的 SVG 文档中的元素 - 无论它是如何嵌入的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-07
      • 2020-06-30
      • 2018-01-23
      • 2011-10-03
      • 2013-10-26
      • 1970-01-01
      • 2017-09-26
      • 1970-01-01
      相关资源
      最近更新 更多