请问有人遇到过此类问题吗?我想用JQ动态修改svg标签的颜色,结果其它浏览器全部都支持,而火狐既然抽风了、、很确定样式已经加上了,但它始终只显示默认的CSS颜色,动态添加的是行内样式都无效,我用的是Iconfont提供的图库,默认给svg加了fill: currentColor;属性,然后通过color来修改其图标颜色。
JQuery添加的:style="color: rgb(204, 204, 204);无效、、、求救
请问有人遇到过此类问题吗?我想用JQ动态修改svg标签的颜色,结果其它浏览器全部都支持,而火狐既然抽风了、、很确定样式已经加上了,但它始终只显示默认的CSS颜色,动态添加的是行内样式都无效,我用的是Iconfont提供的图库,默认给svg加了fill: currentColor;属性,然后通过color来修改其图标颜色。
JQuery添加的:style="color: rgb(204, 204, 204);无效、、、求救
W3C文档如下描述,不知是否能解答疑问
Some styling properties can be specified not only in style sheets and ‘style’ attributes, but also in presentation attributes. These are attributes whose name matches (or is similar to) a given CSS property and whose value is parsed as a value of that property.Presentation attributes contribute to the author level of the cascade, following all other author-level style sheets, and have specificity 0.
Presentation attributes
10 回答11.1k 阅读
6 回答3k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决
3 回答5.1k 阅读✓ 已解决
5 回答1.9k 阅读
唯独火狐有问题的话,可以直接给颜色值试试:#f1f1f1类似于这样。